Comparison

plugins/muc/muc.lib.lua @ 7418:e9f7043b86b5

MUC: Move status text out of <x> element (thanks Tobias)
author Kim Alvefur <zash@zash.se>
date Wed, 04 May 2016 12:14:15 +0200
parent 7416:c33a1d6da016
child 7423:63141a85beea
comparison
equal deleted inserted replaced
7417:4c8ee8175f5e 7418:e9f7043b86b5
529 orig_occupant:set_session(real_jid, generated_unavail); 529 orig_occupant:set_session(real_jid, generated_unavail);
530 dest_nick = select(3, jid_split(dest_occupant.nick)); 530 dest_nick = select(3, jid_split(dest_occupant.nick));
531 if not is_first_dest_session then -- User is swapping into another pre-existing session 531 if not is_first_dest_session then -- User is swapping into another pre-existing session
532 log("debug", "session %s is swapping into multisession %s, showing it leave.", real_jid, dest_occupant.nick); 532 log("debug", "session %s is swapping into multisession %s, showing it leave.", real_jid, dest_occupant.nick);
533 -- Show the other session leaving 533 -- Show the other session leaving
534 local x = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user";}) 534 local x = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user";});
535 :tag("status"):text("you are joining pre-existing session " .. dest_nick):up();
536 add_item(x, self:get_affiliation(bare_jid), "none"); 535 add_item(x, self:get_affiliation(bare_jid), "none");
537 local pr = st.presence{from = dest_occupant.nick, to = real_jid, type = "unavailable"} 536 local pr = st.presence{from = dest_occupant.nick, to = real_jid, type = "unavailable"}
537 :tag("status"):text("you are joining pre-existing session " .. dest_nick):up()
538 :add_child(x); 538 :add_child(x);
539 self:route_stanza(pr); 539 self:route_stanza(pr);
540 end 540 end
541 if is_first_dest_session and is_last_orig_session then -- Normal nick change 541 if is_first_dest_session and is_last_orig_session then -- Normal nick change
542 log("debug", "no sessions in %s left; publically marking as nick change", orig_occupant.nick); 542 log("debug", "no sessions in %s left; publically marking as nick change", orig_occupant.nick);