# HG changeset patch # User Matthew Wild # Date 1235797094 0 # Node ID b1f3977fd14035fe3180475e34eb16d7d3a23c21 # Parent 2d424936723c824aef7edbedee7876d4fe1507ca core.stanza_router: Reply with error to groupchat messages directed at unavailable resources or offline users diff -r 2d424936723c -r b1f3977fd140 core/stanza_router.lua --- a/core/stanza_router.lua Sat Feb 28 02:05:37 2009 +0000 +++ b/core/stanza_router.lua Sat Feb 28 04:58:14 2009 +0000 @@ -217,6 +217,9 @@ 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,6 +266,10 @@ 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