Comparison

plugins/muc/muc.lib.lua @ 2008:6b6b924ee558

MUC: Re-enable nick changes for non-multisession nicks.
author Waqas Hussain <waqas20@gmail.com>
date Sun, 18 Oct 2009 16:45:56 +0500
parent 2006:0c62bed9d338
child 2035:b8c3dbf76a2e
comparison
equal deleted inserted replaced
2007:b89d61db74d1 2008:6b6b924ee558
251 log("debug", "%s broadcasted presence", current_nick); 251 log("debug", "%s broadcasted presence", current_nick);
252 self._occupants[current_nick].sessions[from] = pr; 252 self._occupants[current_nick].sessions[from] = pr;
253 self:broadcast_presence(pr, from); 253 self:broadcast_presence(pr, from);
254 else -- change nick 254 else -- change nick
255 local occupant = self._occupants[current_nick]; 255 local occupant = self._occupants[current_nick];
256 local is_multisession = next(occupant, next(occupant)); 256 local is_multisession = next(occupant.sessions, next(occupant.sessions));
257 if self._occupants[to] or is_multisession then 257 if self._occupants[to] or is_multisession then
258 log("debug", "%s couldn't change nick", current_nick); 258 log("debug", "%s couldn't change nick", current_nick);
259 local reply = st.error_reply(stanza, "cancel", "conflict"):up(); 259 local reply = st.error_reply(stanza, "cancel", "conflict"):up();
260 reply.tags[1].attr.code = "409"; 260 reply.tags[1].attr.code = "409";
261 origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"})); 261 origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"}));