Can i exchange custom messages between client and client having custom format?

Recently i have configured the ejabberd server and i have build a xmpp client using a c++ api. Now i want to exchange some custom messages between client to client passing through the server having some custom format as follows.

<client-details from="source@company-xyz.com" to="destination@company-xyz.com">
    <name></name>
    <feature-id>2</feature-id>
    <feature-set>
        <feature id=1>FileTransfer</feature>
        <feature id=2>FileSharing</feature>
    </feature-set>
</client-details>

Can i do this ? How can i do this?

Thanks in advance.

Possible solution; also check Entity Capabilities

I found how to do it in ejabberd, but I didn't check if that's the better way in Jabber/XMPP.

Send information to another user:

<message to='test2@localhost/Tka'
id='1'
type='chat'>
  <x xmlns='jabber:x:clientdetails'>
    <name></name>
    <feature-id>2</feature-id>
    <feature-set>
        <feature id='1'>FileTransfer</feature>
        <feature id='2'>FileSharing</feature>
    </feature-set>
  </x>
</message>

Broadcast some information to all the contacts:

<presence>
  <x xmlns='jabber:x:clientdetails'>
    <name></name>
    <feature-id>2</feature-id>
    <feature-set>
        <feature id='1'>FileTransfer</feature>
        <feature id='2'>FileSharing</feature>
    </feature-set>
  </x>
</presence>

Also, check XEP-0115: Entity Capabilities because maybe it's interesting for you. Clients like Psi 0.11 and Tkabber 0.10 already implement it.

Syndicate content