Mercurial > prosody-hg
comparison plugins/muc/muc.lib.lua @ 6227:bb75c011b15e
plugins/muc/muc.lib: When user leaves; set their role to nil
| author | daurnimator <quae@daurnimator.com> |
|---|---|
| date | Fri, 18 Apr 2014 12:19:33 -0400 |
| parents | 7582deb85812 |
| children | 8aa59b73f801 |
comparison
equal
deleted
inserted
replaced
| 6226:7582deb85812 | 6227:bb75c011b15e |
|---|---|
| 403 if orig_occupant ~= nil and orig_occupant ~= dest_occupant then | 403 if orig_occupant ~= nil and orig_occupant ~= dest_occupant then |
| 404 local orig_x = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user";}); | 404 local orig_x = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user";}); |
| 405 local dest_nick; | 405 local dest_nick; |
| 406 if dest_occupant == nil then -- Session is leaving | 406 if dest_occupant == nil then -- Session is leaving |
| 407 log("debug", "session %s is leaving occupant %s", real_jid, orig_occupant.nick); | 407 log("debug", "session %s is leaving occupant %s", real_jid, orig_occupant.nick); |
| 408 orig_occupant.role = nil; | |
| 408 orig_occupant:set_session(real_jid, stanza); | 409 orig_occupant:set_session(real_jid, stanza); |
| 409 else | 410 else |
| 410 log("debug", "session %s is changing from occupant %s to %s", real_jid, orig_occupant.nick, dest_occupant.nick); | 411 log("debug", "session %s is changing from occupant %s to %s", real_jid, orig_occupant.nick, dest_occupant.nick); |
| 411 local generated_unavail = st.presence {from = orig_occupant.nick, to = real_jid, type = "unavailable"}; | 412 local generated_unavail = st.presence {from = orig_occupant.nick, to = real_jid, type = "unavailable"}; |
| 412 orig_occupant:set_session(real_jid, generated_unavail); | 413 orig_occupant:set_session(real_jid, generated_unavail); |
