Mercurial > prosody-hg
comparison plugins/muc/muc.lib.lua @ 6120:4520439227fc
plugins/muc/muc.lib: Don't get same variable twice.....
| author | daurnimator <quae@daurnimator.com> |
|---|---|
| date | Wed, 19 Mar 2014 15:01:18 -0400 |
| parents | c13f5d6b9b16 |
| children | 74bbcef3978e |
comparison
equal
deleted
inserted
replaced
| 6119:c13f5d6b9b16 | 6120:4520439227fc |
|---|---|
| 443 local reply = st.error_reply(stanza, "cancel", "conflict"):up(); | 443 local reply = st.error_reply(stanza, "cancel", "conflict"):up(); |
| 444 reply.tags[1].attr.code = "409"; | 444 reply.tags[1].attr.code = "409"; |
| 445 origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"})); | 445 origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"})); |
| 446 return true; | 446 return true; |
| 447 else | 447 else |
| 448 local data = self._occupants[current_nick]; | |
| 449 local to_nick = select(3, jid_split(to)); | 448 local to_nick = select(3, jid_split(to)); |
| 450 log("debug", "%s (%s) changing nick to %s", current_nick, data.jid, to); | 449 log("debug", "%s (%s) changing nick to %s", current_nick, occupant.jid, to); |
| 451 local p = st.presence({type='unavailable', from=current_nick}); | 450 local p = st.presence({type='unavailable', from=current_nick}); |
| 452 self:broadcast_presence(p, from, '303', to_nick); | 451 self:broadcast_presence(p, from, '303', to_nick); |
| 453 self._occupants[current_nick] = nil; | 452 self._occupants[current_nick] = nil; |
| 454 self._occupants[to] = data; | 453 self._occupants[to] = occupant; |
| 455 self._jid_nick[from] = to; | 454 self._jid_nick[from] = to; |
| 456 local pr = get_filtered_presence(stanza); | 455 local pr = get_filtered_presence(stanza); |
| 457 pr.attr.from = to; | 456 pr.attr.from = to; |
| 458 self._occupants[to].sessions[from] = pr; | 457 self._occupants[to].sessions[from] = pr; |
| 459 self:broadcast_presence(pr, from); | 458 self:broadcast_presence(pr, from); |
