mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 17:59:31 +02:00
Merge cda1d4ce7f
into c0c69394b9
This commit is contained in:
commit
9ff11dc58e
1 changed files with 13 additions and 6 deletions
|
@ -526,12 +526,19 @@ notify(LServer, PushLJID, Node, XData, Pkt0, Dir, HandleResponse) ->
|
|||
Item = #ps_item{sub_els = [#push_notification{xdata = Summary}]},
|
||||
PubSub = #pubsub{publish = #ps_publish{node = Node, items = [Item]},
|
||||
publish_options = XData},
|
||||
IQ = #iq{type = set,
|
||||
from = From,
|
||||
to = jid:make(PushLJID),
|
||||
id = p1_rand:get_string(),
|
||||
sub_els = [PubSub]},
|
||||
ejabberd_router:route_iq(IQ, HandleResponse)
|
||||
IQ0 = #iq{type = set,
|
||||
from = From,
|
||||
to = jid:make(PushLJID),
|
||||
id = p1_rand:get_string(),
|
||||
sub_els = [PubSub]},
|
||||
case ejabberd_hooks:run_fold(push_send_notification, LServer, IQ0, [Pkt]) of
|
||||
drop ->
|
||||
?DEBUG("No push notification will be sent: some hook dropped it", []),
|
||||
ok;
|
||||
IQ ->
|
||||
?DEBUG("Push notification hooks built the definitive IQ to route: ~n~ts", [xmpp:pp(IQ)]),
|
||||
ejabberd_router:route_iq(IQ, HandleResponse)
|
||||
end
|
||||
end.
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue