Operation not supported by API: send_message
samhassell - May 13, 2009 - 07:40
| Project: | XMPP Framework |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Testing with the latest dev:
When I run
<?php
xmppframework_send_message( 'sam', 'chat', 'it works!', null);
?>I get the following 2 errors in watchdog:
'Failed to send message to user sam'
'Operation not supported by API: send_message'
Im assuming the first is a result of the second.
I tracked this down to _xmppframework_api_invoke() on line 454 of xmpp_framework.module where $info is being set to
(
[xmpp_api] => Array
(
[name] => XMPP API
[operation] => xmpp_api_operation
[description] => Utilize pure XMPP API via XMPPPHP
)
[xmpp_xmlrpc] => Array
(
[name] => XMLRPC API
[operation] => xmpp_xmlrpc_operation
[description] => Utilize xmlrpc api to XMPP server
)and then function_exists($info['operation']) is being called when it should be something like $info['xmpp_api']['operation'] - ie. $info['operation' is never set.
any ideas?

#1
I should note i tried it with only xmpp_api enabled and the same thing occurs.
#2
Currently for the xmppframework send message i believe the code should look as follows
<?php$admin_conn = xmppframework_get_admin_connection();
$result = xmppframework_send_message($to, 'headline', $body, t('Message being sent'), $admin_conn);
xmppframework_release_connection($admin_conn);
?>
I need to look more into the piece there since it is still development branch hence some pieces like above are not working 100% for the module.
#3
Also note that the first parameter should be a fully qualified JID not just the username i.e. sam@example.com
#4
Inactive and the issue was a result of the jid not being fully qualified.