MUC: Spread event tables over multiple lines
authorKim Alvefur <zash@zash.se>
Fri, 8 Apr 2016 15:53:49 +0000 (17:53 +0200)
committerKim Alvefur <zash@zash.se>
Fri, 8 Apr 2016 15:53:49 +0000 (17:53 +0200)
plugins/muc/muc.lib.lua

index 69d34e75415e22cb964ec4450ffca10eec5c53ac..8a3a3ebd74dd9b7ac12f1688f445d2624a0990d3 100644 (file)
@@ -491,7 +491,11 @@ function room_mt:handle_presence_to_occupant(origin, stanza)
                        self:publicise_occupant_status(orig_occupant, orig_x, dest_nick);
 
                        if is_last_orig_session then
-                               module:fire_event("muc-occupant-left", {room = self; nick = orig_occupant.nick; occupant = orig_occupant;});
+                               module:fire_event("muc-occupant-left", {
+                                       room = self;
+                                       nick = orig_occupant.nick;
+                                       occupant = orig_occupant;
+                               });
                        end
                end
 
@@ -529,9 +533,20 @@ function room_mt:handle_presence_to_occupant(origin, stanza)
 
                        if orig_occupant == nil then
                                if is_first_dest_session then
-                                       module:fire_event("muc-occupant-joined", {room = self; nick = dest_occupant.nick; occupant = dest_occupant;});
+                                       module:fire_event("muc-occupant-joined", {
+                                               room = self;
+                                               nick = dest_occupant.nick;
+                                               occupant = dest_occupant;
+                                       });
                                end
-                               module:fire_event("muc-occupant-session-new", {room = self; nick = dest_occupant.nick; occupant = dest_occupant; stanza = stanza; jid = real_jid;});
+                               module:fire_event("muc-occupant-session-new", {
+                                       room = self;
+                                       nick = dest_occupant.nick;
+                                       occupant = dest_occupant;
+                                       stanza = stanza;
+                                       origin = origin;
+                                       jid = real_jid;
+                               });
                        end
                end
        elseif type ~= 'result' then -- bad type