From a461a41dbea0f57da057a595bf39b555794df616 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Thu, 25 Dec 2008 05:16:11 +0500 Subject: More error replies for offline and non-existing users --- core/stanza_router.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/stanza_router.lua b/core/stanza_router.lua index ac32baa2..fb5b2cbf 100644 --- a/core/stanza_router.lua +++ b/core/stanza_router.lua @@ -229,7 +229,7 @@ function core_route_stanza(origin, stanza) else -- TODO send unavailable presence or unsubscribed end - elseif stanza.name == "message" then + elseif stanza.name == "message" then -- FIXME if full jid, then send out to resources with highest priority 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 @@ -237,12 +237,13 @@ function core_route_stanza(origin, stanza) -- TODO allow configuration of offline storage -- TODO send error if not storing offline elseif stanza.name == "iq" then - -- TODO send IQ error + origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); end else -- user does not exist -- TODO we would get here for nodeless JIDs too. Do something fun maybe? Echo service? Let plugins use xmpp:server/resource addresses? if stanza.name == "presence" then - if stanza.attr.type == "probe" then + local t = stanza.attr.type; + if t == "subscribe" or t == "probe" then origin.send(st.presence({from = to_bare, to = from_bare, type = "unsubscribed"})); end -- else ignore -- cgit v1.2.3