Testing with the latest dev:

When I run

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?

Comments

samhassell’s picture

I should note i tried it with only xmpp_api enabled and the same thing occurs.

darren.ferguson’s picture

Currently for the xmppframework send message i believe the code should look as follows


$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.

darren.ferguson’s picture

Also note that the first parameter should be a fully qualified JID not just the username i.e. sam@example.com

darren.ferguson’s picture

Status: Active » Closed (fixed)

Inactive and the issue was a result of the jid not being fully qualified.