Using ad-hoc commands (xep xep-0050)

Hello there,

I'm playing with ad-hoc commands (xep-0050), but I'm unable to understand how to announce/publish and execute commands. I'm sending queries from one client to another, and the server answer in behalf of the responder (which never receives the request). So, I'm not sure if I understand correctly the xep, or if there is something different about the server.

For instance, supose the user bar@slack-lap.casa is querying foo@slack-lap.casa about the commands it supports:

<iq type='get'
    from='bar@slack-lap.casa'
    to='foo@slack-lap.casa'>
  <query xmlns='http://jabber.org/protocol/disco#items'
         node='http://jabber.org/protocol/commands'/>
</iq>

The server responds in behalf of foo with an empty list:

<iq from="foo@slack-lap.casa" type="result" to="bar@slack-lap.casa/Psi" >
<query xmlns="http://jabber.org/protocol/disco#items" node="http://jabber.org/protocol/commands" />
</iq>

So, foo@slack-lap.casa never gets the query, therefore, it can't send a response with his own list of commands.

So, I can't understand how can I attach some commands to foo@slack-lap.casa and having other JIDs (like bar@) querying for these commands and execute them. I must be missing something...

Can anyone help? (using ejabberd 1.1.4)

Thannks,
Thiago

Anonymous wrote: Hello

Anonymous wrote:

Hello there,

I'm playing with ad-hoc commands (xep-0050), but I'm unable to understand how to announce/publish and execute commands. I'm sending queries from one client to another, and the server answer in behalf of the responder (which never receives the request). So, I'm not sure if I understand correctly the xep, or if there is something different about the server.

There is. See section 11.1.4.3 of XMPP-IM.

Anonymous wrote:

For instance, supose the user bar@slack-lap.casa is querying foo@slack-lap.casa about the commands it supports:

<iq type='get'
    from='bar@slack-lap.casa'
    to='foo@slack-lap.casa'>
  <query xmlns='http://jabber.org/protocol/disco#items'
         node='http://jabber.org/protocol/commands'/>
</iq>

The server responds in behalf of foo with an empty list:

<iq from="foo@slack-lap.casa" type="result" to="bar@slack-lap.casa/Psi" >
<query xmlns="http://jabber.org/protocol/disco#items" node="http://jabber.org/protocol/commands" />
</iq>

If bar@slack-lap.casa had administrative privileges, it would see the administrative commands provided by the server. (But that's not relevant to your question)

Anonymous wrote:

So, I can't understand how can I attach some commands to foo@slack-lap.casa and having other JIDs (like bar@) querying for these commands and execute them. I must be missing something...

Send the disco query to the full JID, e.g. foo@slack-lap.casa/Psi.

Syndicate content