[ejabberd] PubSub subscription problem

Boris Okner boris.okner at gmail.com
Tue Apr 20 22:40:14 MSD 2010


Thanks a lot kael,

I tried pubsub#presence_based_delivery in some of earlier versions with no
luck, wasn't sure if that was a bug or my misunderstanding. Will definitely
try your patch.

Best regards,
Boris

2010/4/20 kael <ka-el at laposte.net>

> On 04/20/2010 01:16 PM, Boris Okner wrote:
>
>> Here is a problem: ejabberd doesn't yet remove subscriptions for resources
>> that went offline. So what happens is that all such stale subscriptions get
>> transferred to a still active resources of the same account. Without knowing
>> SubId, it's hard to filter out all that noise.  Is it possible that you keep
>> SubID for the time being until above problem is solved?
>>
>
> Alternatively, the solution is to create and configure a node (or simply to
> configure it) with the following parameter :
>
> <iq type='set' to='pubsub.localhost'>
>  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
>  <create node='feeds.Temperature.sensor1.devices'/>
>  <configure>
>   <x xmlns='jabber:x:data' type='submit'>
>    <field var='FORM_TYPE' type='hidden'>
>     <value>http://jabber.org/protocol/pubsub#node_config</value>
>    </field>
>    <field var='pubsub#presence_based_delivery'>
>     <value>true</value>
>    </field>
>   </x>
>  </configure>
>  </pubsub>
> </iq>
>
>
> Then, the subscription has to be done with a full JID :
>
> <iq type='set' to='pubsub.localhost'>
>  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
>  <subscribe node='feeds.Temperature.sensor1.devices'
>             jid='joe at localhost/25353072781271737576681426'/>
>  </pubsub>
> </iq>
>
> This way, messages are sent only to the available resources.
>
>
> But there's a bug with 'pubsub#presence_based_delivery'. I wrote a patch
> (attached) to fix this bug for ejabberd 2.1.3.
>
> Copy the patch into src/mod_pubsub/, then :
>
> $ cd src/mod_pubsub/
> $ patch -p0 < mod_pubsub.patch
>
>
> So now with 'pubsub#presence_based_delivery' = 'true', available resources
> should only receive messages sent to them, except in the case of
> subscriptions with a bare JID, in which case each available resource will
> receive a message.
>
> --
> kael
>
> _______________________________________________
> ejabberd mailing list
> ejabberd at jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20100420/7f5e4d8d/attachment-0001.html>


More information about the ejabberd mailing list