diff options
Diffstat (limited to 'core/stanza_router.lua')
-rw-r--r-- | core/stanza_router.lua | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua index 1ebc158d..23b7a37d 100644 --- a/core/stanza_router.lua +++ b/core/stanza_router.lua @@ -217,6 +217,9 @@ function core_route_stanza(origin, stanza) session.send(stanza); end end + elseif resource and stanza.attr.type == 'groupchat' then + -- Groupchat message sent to offline resource + origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); else local priority = 0; local recipients = {}; @@ -263,10 +266,14 @@ function core_route_stanza(origin, stanza) if stanza.attr.type == "chat" or stanza.attr.type == "normal" or not stanza.attr.type then offlinemanager.store(node, host, stanza); -- FIXME don't store messages with only chat state notifications + elseif stanza.attr.type == "groupchat" then + local reply = st.error_reply(stanza, "cancel", "service-unavailable"); + reply.attr.from = to; + origin.send(reply); end -- TODO allow configuration of offline storage -- TODO send error if not storing offline - elseif stanza.name == "iq" then + elseif stanza.name == "iq" and (stanza.attr.type == "get" or stanza.attr.type == "set") then origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); end else -- user does not exist @@ -277,7 +284,7 @@ function core_route_stanza(origin, stanza) origin.send(st.presence({from = to_bare, to = from_bare, type = "unsubscribed"})); end -- else ignore - else + elseif stanza.attr.type ~= "error" and (stanza.name ~= "iq" or stanza.attr.type ~= "result") then origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); end end |