Providing server features through a plugin (for XEP-0136)

To add server features to Openfire it seems I have to implement Module and ServerFeaturesProvider.

IQDiscoInfoHandler then iterates them and prepares the response to the iq disco request sent the the server’'s jid.

Available modules are defined in loadModules() in XMPPServer.

I see no way to add custom modules through a plugin though. It seems I have to do this to announce features like

to the client when it connects.

How can I achieve this?

You can add a module, inside a plugin as well. I would reference the gateway plugin for a good way of doing this.

Alex

I had a look at the gateway plugin and it seems to me that it is using components for this.

What I am looking for is adding features to the server’'s JID (e.g. mydomain.com) and not to the JID of a component (e.g. msn.mydomain.com).

Check IQDiscoInfoHandler#setServerNodeInforProvider

I believe that is what you are looking for.

Thanks,

Alex

Doesnt IQDiscoInfoHandler#setServerNodeInforProvider require a node (namespace)?

XEP-0136 is different from XEP-0013 for example as it doesnt include a node in the disco query:

Example 1. Client Service Discovery request

<iq type=''get'' id=''disco1''>
  <query xmlns=''http://jabber.org/protocol/disco#info''></query>
</iq>

Example 2. Server Service Discovery response

<iq type=''result'' to=''romeo@montague.net/orchard'' id=''disco1''>
  <query xmlns=''http://jabber.org/protocol/disco#info''></query>
    ...
    <feature var=''http://www.xmpp.org/extensions/xep-0136.html#ns-auto''></feature>
    <feature var=''http://www.xmpp.org/extensions/xep-0136.html#ns-encrypt''></feature>
    <feature var=''http://www.xmpp.org/extensions/xep-0136.html#ns-manage''></feature>
    <feature var=''http://www.xmpp.org/extensions/xep-0136.html#ns-manual''></feature>
    <feature var=''http://www.xmpp.org/extensions/xep-0136.html#ns-pref''></feature>
    ...
  </query>
</iq>

Related to this is the requirement to handle iq set messages sent to the server node:

<iq type=''set'' id=''pref3''>
  <pref xmlns=''http://www.xmpp.org/extensions/xep-0136.html#ns''>
    <item jid=''romeo@montague.net'' save=''body'' expire=''604800'' otr=''concede''></item>
  </pref>
</iq>

This also seems to be only possible by registering a module with the XMPPServer which is only possible by hard coding the module into XMPPServer.

See http://www.xmpp.org/extensions/xep-0136.html

Ok a combination of IQDiscoInfoHandler#addServerFeature and IQRouter#addHandler finally did the job.

Hi Stefan;

Can u tell me more about the combination below (with sample code):

Ok a combination of IQDiscoInfoHandler#addServerFeature and IQRouter#addHandler finally did the job.

I want to send a disco#info to the server domain (mydomain.com) and return the features.

Thank you;