aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2008-12-25 05:16:11 +0500
committerWaqas Hussain <waqas20@gmail.com>2008-12-25 05:16:11 +0500
commita461a41dbea0f57da057a595bf39b555794df616 (patch)
tree82ad2fc272284d31aaf0119147263faf51383e6b
parentf963d6de4a808f498233b4dfa5cb01ebd0e26655 (diff)
downloadprosody-a461a41dbea0f57da057a595bf39b555794df616.tar.gz
prosody-a461a41dbea0f57da057a595bf39b555794df616.zip
More error replies for offline and non-existing users
-rw-r--r--core/stanza_router.lua7
1 files changed, 4 insertions, 3 deletions
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