aboutsummaryrefslogtreecommitdiff
path: root/src/mod_pubsub.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/mod_pubsub.erl')
-rw-r--r--src/mod_pubsub.erl10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl
index 8cbd994e0..1d8bd143c 100644
--- a/src/mod_pubsub.erl
+++ b/src/mod_pubsub.erl
@@ -3356,6 +3356,8 @@ send_items(Host, Node, NodeId, Type, {U, S, R} = LJID,
_ -> []
end,
Stanza = case ToSend of
+ [] ->
+ undefined;
[LastItem] ->
{ModifNow, ModifUSR} =
LastItem#pubsub_item.modification,
@@ -3369,11 +3371,13 @@ send_items(Host, Node, NodeId, Type, {U, S, R} = LJID,
attrs = nodeAttr(Node),
children = itemsEls(ToSend)}])
end,
- case is_tuple(Host) of
- false ->
+ case {is_tuple(Host), Stanza} of
+ {_, undefined} ->
+ ok;
+ {false, _} ->
ejabberd_router:route(service_jid(Host),
jlib:make_jid(LJID), Stanza);
- true ->
+ {true, _} ->
case ejabberd_sm:get_session_pid(U, S, R) of
C2SPid when is_pid(C2SPid) ->
ejabberd_c2s:broadcast(C2SPid,