aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-09-25 03:21:57 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-09-25 03:21:57 +0500
commit8ab6d1e46448dc2991e764ffa6b88ef5c55cacd6 (patch)
tree29706262e168d01d5ed8b520445990aa0f6dd759
parent41efc95388858b84f342545f5a139a7872782b8d (diff)
downloadprosody-8ab6d1e46448dc2991e764ffa6b88ef5c55cacd6.tar.gz
prosody-8ab6d1e46448dc2991e764ffa6b88ef5c55cacd6.zip
MUC: Added legacy error codes to nickname conflict presence errors.
-rw-r--r--plugins/muc/muc.lib.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index fb72a9e3..43b8eb4f 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -240,7 +240,9 @@ function room_mt:handle_to_occupant(origin, stanza) -- PM, vCards, etc
else -- change nick
if self._occupants[to] then
log("debug", "%s couldn't change nick", current_nick);
- origin.send(st.error_reply(stanza, "cancel", "conflict"):tag("x", {xmlns = "http://jabber.org/protocol/muc"}));
+ local reply = st.error_reply(stanza, "cancel", "conflict"):up();
+ reply.tags[1].attr.code = "409";
+ origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"}));
else
local data = self._occupants[current_nick];
local to_nick = select(3, jid_split(to));
@@ -272,7 +274,9 @@ function room_mt:handle_to_occupant(origin, stanza) -- PM, vCards, etc
end
if not new_nick then
log("debug", "%s couldn't join due to nick conflict: %s", from, to);
- origin.send(st.error_reply(stanza, "cancel", "conflict"):tag("x", {xmlns = "http://jabber.org/protocol/muc"}));
+ local reply = st.error_reply(stanza, "cancel", "conflict"):up();
+ reply.tags[1].attr.code = "409";
+ origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"}));
else
log("debug", "%s joining as %s", from, to);
if not next(self._affiliations) then -- new room, no owners