aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristophe Romain <christophe.romain@process-one.net>2016-03-25 17:52:08 +0100
committerChristophe Romain <christophe.romain@process-one.net>2016-05-02 15:04:14 +0200
commit07196b6c62e200298dbbe46f9ecaa4eabf5e6e16 (patch)
tree795c5adf01aa361294bc877872868775156cb516 /src
parentDon't halt program when include_config_file is missing/can't be read (diff)
Fix sender in case of explicit pep subscriptions
Diffstat (limited to 'src')
-rw-r--r--src/mod_pubsub.erl10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl
index 7ec2fe57c..35173a4f2 100644
--- a/src/mod_pubsub.erl
+++ b/src/mod_pubsub.erl
@@ -3172,11 +3172,9 @@ subscription_to_string(_) -> <<"none">>.
Host :: mod_pubsub:host())
-> jid()
).
-service_jid(Host) ->
- case Host of
- {U, S, _} -> {jid, U, S, <<>>, U, S, <<>>};
- _ -> {jid, <<>>, Host, <<>>, <<>>, Host, <<>>}
- end.
+service_jid(#jid{} = Jid) -> Jid;
+service_jid({U, S, R}) -> jid:make(U, S, R);
+service_jid(Host) -> jid:make(<<>>, Host, <<>>).
%% @spec (LJID, NotifyType, Depth, NodeOptions, SubOptions) -> boolean()
%% LJID = jid()
@@ -3525,7 +3523,7 @@ broadcast_stanza(Host, _Node, _Nidx, _Type, NodeOptions, SubsByDepth, NotifyType
end, SubIDsByJID).
broadcast_stanza({LUser, LServer, LResource}, Publisher, Node, Nidx, Type, NodeOptions, SubsByDepth, NotifyType, BaseStanza, SHIM) ->
- broadcast_stanza({LUser, LServer, LResource}, Node, Nidx, Type, NodeOptions, SubsByDepth, NotifyType, BaseStanza, SHIM),
+ broadcast_stanza({LUser, LServer, <<>>}, Node, Nidx, Type, NodeOptions, SubsByDepth, NotifyType, BaseStanza, SHIM),
%% Handles implicit presence subscriptions
SenderResource = user_resource(LUser, LServer, LResource),
case ejabberd_sm:get_session_pid(LUser, LServer, SenderResource) of