Hello,
I have a number of connections for the same user (same bare jid,automatically created resource identifier). Lets say:
lezebre@example.com/aaaaaa
lezebre@example.com/bbbbbb
All users subscribe to the same pubsub node (node.lezebre) and each user should get an notification event if an item is published or retracted. The best way to do this would be to create a temporary subscription (XEP-0060 12.4) using the full jid, but unfortunately openfire 3.8.2 does not support this feature, right?
So my idea was to create a subscription with a bare jid to that node having the assumption publishing to the bare jid would cause openfire to send notifications to all instances of this user.
Subscribing works:
<iq to='pubsub.example.com' type='set' xmlns='jabber:client' id='2115:sendIQ'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<subscribe node='node.lezebre' jid='lezebre@example.com'/>
<options>
<x xmlns='jabber:x:data' type='submit'>
<field var='FORM_TYPE' type='hidden'>
<value>http://jabber.org/protocol/pubsub#subscribe_options</value>
</field>
<field var='pubsub#include_body'>
<value>1</value>
</field>
<field var='pubsub#subscription_type'>
<value>items</value>
</field>
</x>
</options>
</pubsub>
</iq>
<iq xmlns="jabber:client" type="result" id="2115:sendIQ" from="pubsub.example.com" to="lezebre@example.com/aaaaaa">
<pubsub xmlns="http://jabber.org/protocol/pubsub">
<subscription node="node.lezebre" jid="lezebre@example.com" subid="Tg8Urhi3W04yknlyxNoxU8O0iEDVuFW830BuHwg3" subscription="subscribed">
<subscribe-options/>
</subscription>
</pubsub>
</iq>
So both users are connected now and lezebre@example.com/aaaaaa publishes an item to node:
<iq to='pubsub.example.com' type='set' xmlns='jabber:client' id='7839:sendIQ'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='node.lezebre'>
<item id='32c1f0461a7ac9164a838b53fdc42014'>
<payload xmlns='...'>payload</payload>
</item>
</publish>
</pubsub>
</iq>
<message xmlns="jabber:client" from="pubsub.example.com" to="lezebre@example.com" id="node.lezebre__lezebre@example.com__73gmt">
<event xmlns="http://jabber.org/protocol/pubsub#event">
<items node="node.lezebre">
<item id="32c1f0461a7ac9164a838b53fdc42014">
</item>
</items>
</event>
<headers xmlns="http://jabber.org/protocol/shim">
<header name="pubsub#subid">Tg8Urhi3W04yknlyxNoxU8O0iEDVuFW830BuHwg3</header>
</headers>
</message>
User lezebre@example.com/aaaaaa gets this notification, but lezebre@example.com/bbbbbb does not. Same is if lezebre@example.com/bbbbbb publishes an item he gets this event, but lezebre@example.com/aaaaaa does not. Am i doing something wrong or is this a bug?
If i subscribe both users to the node using the full jid it works perfectly, but as the resource identifier is completely random it creates more and more subscriptions in the database that never will be deleted again. So that's not a good idea.
Can anybody please help me on this?
Thanks alot.