Mercurial > prosody-hg
comparison util/muc.lua @ 1621:a63ff2fbba8d 0.5.1
MUC: Added the MUC child element to conflict errors
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Wed, 29 Jul 2009 18:02:05 +0500 |
| parents | 2437dcd46937 |
| children | cc7f212b2c48 |
comparison
equal
deleted
inserted
replaced
| 1620:7acb630bdac9 | 1621:a63ff2fbba8d |
|---|---|
| 207 self._participants[current_nick].sessions[from] = pr; | 207 self._participants[current_nick].sessions[from] = pr; |
| 208 room_broadcast_presence(self, pr); | 208 room_broadcast_presence(self, pr); |
| 209 else -- change nick | 209 else -- change nick |
| 210 if self._participants[to] then | 210 if self._participants[to] then |
| 211 log("debug", "%s couldn't change nick", current_nick); | 211 log("debug", "%s couldn't change nick", current_nick); |
| 212 origin.send(st.error_reply(stanza, "cancel", "conflict")); | 212 origin.send(st.error_reply(stanza, "cancel", "conflict"):tag("x", {xmlns = "http://jabber.org/protocol/muc"})); |
| 213 else | 213 else |
| 214 local data = self._participants[current_nick]; | 214 local data = self._participants[current_nick]; |
| 215 local to_nick = select(3, jid_split(to)); | 215 local to_nick = select(3, jid_split(to)); |
| 216 if to_nick then | 216 if to_nick then |
| 217 log("debug", "%s (%s) changing nick to %s", current_nick, data.jid, to); | 217 log("debug", "%s (%s) changing nick to %s", current_nick, data.jid, to); |
| 238 if self._participants[to] then | 238 if self._participants[to] then |
| 239 new_nick = nil; | 239 new_nick = nil; |
| 240 end | 240 end |
| 241 if not new_nick then | 241 if not new_nick then |
| 242 log("debug", "%s couldn't join due to nick conflict: %s", from, to); | 242 log("debug", "%s couldn't join due to nick conflict: %s", from, to); |
| 243 origin.send(st.error_reply(stanza, "cancel", "conflict")); | 243 origin.send(st.error_reply(stanza, "cancel", "conflict"):tag("x", {xmlns = "http://jabber.org/protocol/muc"})); |
| 244 else | 244 else |
| 245 log("debug", "%s joining as %s", from, to); | 245 log("debug", "%s joining as %s", from, to); |
| 246 local data; | 246 local data; |
| 247 -- if not rooms:get(room) and not rooms_info:get(room) then -- new room | 247 -- if not rooms:get(room) and not rooms_info:get(room) then -- new room |
| 248 -- rooms_info:set(room, 'name', (jid_split(room))); | 248 -- rooms_info:set(room, 'name', (jid_split(room))); |
