]> granicus.if.org Git - ejabberd/commitdiff
PubSub: fix notification on subscription change
authorChristophe Romain <christophe.romain@process-one.net>
Thu, 29 Sep 2016 10:00:59 +0000 (12:00 +0200)
committerChristophe Romain <christophe.romain@process-one.net>
Thu, 29 Sep 2016 10:00:59 +0000 (12:00 +0200)
src/mod_pubsub.erl

index d64d057378e77c59daa2961dcba49722332d1587..31170bc74fb7832a5bf60fba6fc7e72fe2b5133d 100644 (file)
@@ -2916,15 +2916,11 @@ set_subscriptions(Host, Node, From, EntitiesEls) ->
            {error, ?ERR_BAD_REQUEST};
        _ ->
            Notify = fun (JID, Sub, _SubId) ->
-                   Stanza = #xmlel{name = <<"message">>, attrs = [],
-                           children =
-                           [#xmlel{name = <<"pubsub">>,
-                                   attrs = [{<<"xmlns">>, ?NS_PUBSUB}],
-                                   children =
+                   Stanza = event_stanza(
                                    [#xmlel{name = <<"subscription">>,
                                            attrs = [{<<"jid">>, jid:to_string(JID)},
                                                {<<"subscription">>, subscription_to_string(Sub)}
-                                               | nodeAttr(Node)]}]}]},
+                                               | nodeAttr(Node)]}]),
                    ejabberd_router:route(service_jid(Host), jid:make(JID), Stanza)
            end,
            Action = fun (#pubsub_node{type = Type, id = Nidx, owners = O}) ->