Comparison

plugins/muc/muc.lib.lua @ 7427:bf43a08e5a74

MUC: Send participant list and subject on explicit joins (thanks daurnimator)
author Kim Alvefur <zash@zash.se>
date Sun, 15 May 2016 16:55:19 +0200
parent 7426:3a90e9732204
child 7444:45d28235ebe0
comparison
equal deleted inserted replaced
7426:3a90e9732204 7427:bf43a08e5a74
575 if orig_occupant == nil and self:get_whois() == "anyone" then 575 if orig_occupant == nil and self:get_whois() == "anyone" then
576 dest_x:tag("status", {code = "100"}):up(); 576 dest_x:tag("status", {code = "100"}):up();
577 end 577 end
578 self:save_occupant(dest_occupant); 578 self:save_occupant(dest_occupant);
579 579
580 if orig_occupant == nil then 580 if orig_occupant == nil or muc_x then
581 -- Send occupant list to newly joined user 581 -- Send occupant list to newly joined user
582 self:send_occupant_list(real_jid, function(nick, occupant) -- luacheck: ignore 212 582 self:send_occupant_list(real_jid, function(nick, occupant) -- luacheck: ignore 212
583 -- Don't include self 583 -- Don't include self
584 return occupant:get_presence(real_jid) == nil; 584 return occupant:get_presence(real_jid) == nil;
585 end) 585 end)
596 -- TODO: new status code to inform client this was the multi-session it left? 596 -- TODO: new status code to inform client this was the multi-session it left?
597 pr:add_child(x); 597 pr:add_child(x);
598 self:route_stanza(pr); 598 self:route_stanza(pr);
599 end 599 end
600 600
601 if orig_occupant == nil then 601 if orig_occupant == nil or muc_x then
602 if is_first_dest_session then 602 if is_first_dest_session then
603 module:fire_event("muc-occupant-joined", { 603 module:fire_event("muc-occupant-joined", {
604 room = self; 604 room = self;
605 nick = dest_occupant.nick; 605 nick = dest_occupant.nick;
606 occupant = dest_occupant; 606 occupant = dest_occupant;