MUC: Log cases of possible room resynchronisation
authorKim Alvefur <zash@zash.se>
Thu, 28 Apr 2016 20:03:00 +0000 (22:03 +0200)
committerKim Alvefur <zash@zash.se>
Thu, 28 Apr 2016 20:03:00 +0000 (22:03 +0200)
plugins/muc/muc.lib.lua

index ce6c57840819c30010c87ccc5c18323e2064bcb1..dde1e13f6e1d7c91d4dd21f9172127613010f82d 100644 (file)
@@ -429,6 +429,14 @@ function room_mt:handle_presence_to_occupant(origin, stanza)
                        is_last_orig_session = iter(ob, iter(ob, last)) == nil;
                end
 
+               -- TODO Handle these cases sensibly
+               local muc_x = stanza:get_child("x", "http://jabber.org/protocol/muc");
+               if orig_occupant == nil and not muc_x then
+                       module:log("debug", "Join without <x>, possibly desynced");
+               elseif orig_occupant ~= nil and muc_x then
+                       module:log("debug", "Presence update with <x>, possibly desynced");
+               end
+
                local event, event_name = {
                        room = self;
                        origin = origin;