mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
PubSub: fix notification on subscription change
This commit is contained in:
parent
a42bf67957
commit
767dba8f3b
@ -2916,15 +2916,11 @@ set_subscriptions(Host, Node, From, EntitiesEls) ->
|
|||||||
{error, ?ERR_BAD_REQUEST};
|
{error, ?ERR_BAD_REQUEST};
|
||||||
_ ->
|
_ ->
|
||||||
Notify = fun (JID, Sub, _SubId) ->
|
Notify = fun (JID, Sub, _SubId) ->
|
||||||
Stanza = #xmlel{name = <<"message">>, attrs = [],
|
Stanza = event_stanza(
|
||||||
children =
|
|
||||||
[#xmlel{name = <<"pubsub">>,
|
|
||||||
attrs = [{<<"xmlns">>, ?NS_PUBSUB}],
|
|
||||||
children =
|
|
||||||
[#xmlel{name = <<"subscription">>,
|
[#xmlel{name = <<"subscription">>,
|
||||||
attrs = [{<<"jid">>, jid:to_string(JID)},
|
attrs = [{<<"jid">>, jid:to_string(JID)},
|
||||||
{<<"subscription">>, subscription_to_string(Sub)}
|
{<<"subscription">>, subscription_to_string(Sub)}
|
||||||
| nodeAttr(Node)]}]}]},
|
| nodeAttr(Node)]}]),
|
||||||
ejabberd_router:route(service_jid(Host), jid:make(JID), Stanza)
|
ejabberd_router:route(service_jid(Host), jid:make(JID), Stanza)
|
||||||
end,
|
end,
|
||||||
Action = fun (#pubsub_node{type = Type, id = Nidx, owners = O}) ->
|
Action = fun (#pubsub_node{type = Type, id = Nidx, owners = O}) ->
|
||||||
|
Loading…
Reference in New Issue
Block a user