Mercurial > prosody-hg
comparison plugins/muc/muc.lib.lua @ 8170:627689c058aa
Backed out changeset a6574fdf8734, violates XEP-0045
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 03 Jul 2017 17:32:13 +0200 |
| parents | a6574fdf8734 |
| children | 79f73af4c410 |
comparison
equal
deleted
inserted
replaced
| 8169:a6574fdf8734 | 8170:627689c058aa |
|---|---|
| 347 error_message = error_message..": "..text; | 347 error_message = error_message..": "..text; |
| 348 end | 348 end |
| 349 occupant:set_session(real_jid, st.presence({type="unavailable"}) | 349 occupant:set_session(real_jid, st.presence({type="unavailable"}) |
| 350 :tag('status'):text(error_message)); | 350 :tag('status'):text(error_message)); |
| 351 self:save_occupant(occupant); | 351 self:save_occupant(occupant); |
| 352 local x = { | 352 local x = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user";}) |
| 353 base = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user";}); | 353 :tag("status", {code = "307"}) |
| 354 self = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user";}) | |
| 355 :tag("status", {code = "307"}); | |
| 356 }; | |
| 357 self:publicise_occupant_status(occupant, x); | 354 self:publicise_occupant_status(occupant, x); |
| 358 if occupant.jid == real_jid then -- Was last session | 355 if occupant.jid == real_jid then -- Was last session |
| 359 module:fire_event("muc-occupant-left", {room = self; nick = occupant.nick; occupant = occupant;}); | 356 module:fire_event("muc-occupant-left", {room = self; nick = occupant.nick; occupant = occupant;}); |
| 360 end | 357 end |
| 361 return true; | 358 return true; |
| 1299 end | 1296 end |
| 1300 end | 1297 end |
| 1301 | 1298 |
| 1302 local x = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user"}); | 1299 local x = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user"}); |
| 1303 if not role then | 1300 if not role then |
| 1304 x = { | 1301 x:tag("status", {code = "307"}):up(); |
| 1305 base = x; | |
| 1306 self = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user"}) | |
| 1307 :tag("status", {code = "307"}):up(); | |
| 1308 }; | |
| 1309 end | 1302 end |
| 1310 occupant.role = role; | 1303 occupant.role = role; |
| 1311 self:save_occupant(occupant); | 1304 self:save_occupant(occupant); |
| 1312 self:publicise_occupant_status(occupant, x, nil, actor, reason); | 1305 self:publicise_occupant_status(occupant, x, nil, actor, reason); |
| 1313 if role == nil then | 1306 if role == nil then |
