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
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] =&gt; Array
        (
            [name] =&gt; XMPP API
            [operation] =&gt; xmpp_api_operation
            [description] =&gt; Utilize pure XMPP API via XMPPPHP
        )

    [xmpp_xmlrpc] =&gt; Array
        (
            [name] =&gt; XMLRPC API
            [operation] =&gt; xmpp_xmlrpc_operation
            [description] =&gt; 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

samhassell - May 13, 2009 - 07:42

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

#2

darren.ferguson - May 13, 2009 - 12:57

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

darren.ferguson - May 13, 2009 - 12:58

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

#4

darren.ferguson - August 27, 2009 - 22:00
Status:active» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.