25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-24 17:29:28 +01:00

Fix PubSub send last published items (#1572)

This commit is contained in:
Christophe Romain 2017-08-01 17:00:52 +02:00
parent f22bd6eb46
commit 5e26190b98

View File

@ -671,16 +671,14 @@ caps_update(#jid{luser = U, lserver = S, lresource = R}, #jid{lserver = Host} =
presence(Host, {presence, U, S, [R], JID}).
-spec presence_probe(jid(), jid(), pid()) -> ok.
presence_probe(#jid{luser = U, lserver = S, lresource = R} = JID, JID, Pid) ->
presence(S, {presence, JID, Pid}),
presence(S, {presence, U, S, [R], JID});
presence_probe(#jid{luser = U, lserver = S}, #jid{luser = U, lserver = S}, _Pid) ->
%% ignore presence_probe from my other ressources
%% to not get duplicated last items
ok;
presence_probe(#jid{luser = U, lserver = S, lresource = R}, #jid{lserver = S} = JID, _Pid) ->
presence(S, {presence, U, S, [R], JID});
presence_probe(_Host, _JID, _Pid) ->
presence_probe(#jid{lserver = S} = From, #jid{lserver = S} = To, Pid) ->
presence(S, {presence, From, Pid}),
presence(S, {presence, From#jid.luser, S, [From#jid.lresource], To});
presence_probe(_From, _To, _Pid) ->
%% ignore presence_probe from remote contacts,
%% those are handled via caps_add
ok.