1
votes

We were using openfire 3.7.1 as our XMPP server, and we wanted to extend the Presence stanza to include some extra information like:

<presence from="[email protected]">
    <body>...</body>
    <custom_element>
        <custom_data/>
    </custom_element>
</presence>

Could you please show me some pointers as what would be a better approach to do so? E.g., should I modify or extend some XMPP schema so that openfire will process the above presence packet as usual (currently if I send message like above, openfire seems not taking it as a Presence packet)? And should I create a plugin to intercept all packets so as to process our custom elements?

Thanks in Advance!

1

1 Answers

6
votes

This is how it is normally done:

<presence from="[email protected]">        
    <x xmlms="http://mycompany.com/mycustomnamespace1>
        <custom_data/>
    </x>
</presence>

Openfire will route such a packet without any problems. You only need a server plugin when the server has to process any action on this custom elements. When the server should route the presence only to your contacts then nothing is required on the server.