[ejabberd] PubSub Multi-Subscribe

Mickaël Rémond mremond at process-one.net
Tue Aug 2 17:30:32 MSK 2016


Since 16.01, ejabberd disable multi-subscribe feature by default, but it
does not purge old subscription by itself when you upgraded from an older
version, as we can not make automatic decision on what is best for the

Here are two solution for purging subscriptions:

1. User centric solution:
- get all my subscriptions
- for each multi-subscriptions with subid, explicitely remove them
   adding corresponding subid in the unsubscribe stanza

2. Server centric solution:
- if using sql backend, list duplicated subscriptions and keep only one
- if using mnesia, run code like this in ejabberd debug console to keep
   only the last added subscription:

  Clean = fun({pubsub_state, I, L, A, Ss}) ->
   S = case Ss of
     [First|_] -> First;
     [] -> []
   {pubsub_state, I, L, A, S}
  [mnesia:dirty_write(Clean(R)) || R<-ets:tab2list(pubsub_state)].

I hope this helps,

Mickaël Rémond

On Mon, Jul 18, 2016 at 5:53 PM Florian Sailer <fs at sailer-interactive.com>

> Hi,
> is it possible to disable "multi-subscribe" in the ejabberd PubSub
> module? I found a post mentioning that this should be possible starting
> with 16.01
> http://stackoverflow.com/questions/34618854/how-can-i-disable-multi-subscription-on-pubsub-node-in-ejabberd
> Im using 16.06 and multi-subscribe still seems to be the default
> behaviour. Is there any config option to disable this?
> Best,
> Florian
> _______________________________________________
> 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/20160802/c837831d/attachment.html>

More information about the ejabberd mailing list