From: Christophe Romain Date: Thu, 29 Sep 2016 10:00:59 +0000 (+0200) Subject: PubSub: fix notification on subscription change X-Git-Tag: 16.12~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=767dba8f3bc526a502a57afd2f8313b630f15877;p=ejabberd PubSub: fix notification on subscription change --- diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl index d64d05737..31170bc74 100644 --- a/src/mod_pubsub.erl +++ b/src/mod_pubsub.erl @@ -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}) ->