diff --git a/src/plugins/plugin_xep_0045.py b/src/plugins/plugin_xep_0045.py index 9062e34c..ef10760c 100755 --- a/src/plugins/plugin_xep_0045.py +++ b/src/plugins/plugin_xep_0045.py @@ -754,7 +754,12 @@ class SatMUCClient(muc.MUCClient): log.debug(u"room {room} joined with nick {nick}".format(room=room.occupantJID.userhost(), nick=user.nick)) # We set type so we don't have use a deferred with disco to check entity type self.host.memory.updateEntityData(room.roomJID, C.ENTITY_TYPE, ENTITY_TYPE_MUC, profile_key=self.parent.profile) - + elif not room._room_ok: + log.warning(u"Received user presence data in a room before its initialisation (and after our own presence)," + "this is not standard! Ignoring it: {} ({})".format( + room.roomJID.userhost(), + user.nick)) + return elif room._roster_ok: try: self._changing_nicks.remove(user.nick) @@ -795,6 +800,12 @@ class SatMUCClient(muc.MUCClient): room = room_jid_s, profile = self.parent.profile)) self.host.memory.delEntityCache(room.roomJID, profile_key=self.parent.profile) self.host.bridge.mucRoomLeft(room.roomJID.userhost(), self.parent.profile) + elif not room._room_ok: + log.warning(u"Received user presence data in a room before its initialisation (and after our own presence)," + "this is not standard! Ignoring it: {} ({})".format( + room.roomJID.userhost(), + user.nick)) + return else: log.debug(_(u"user {nick} left room {room_id}").format(nick=user.nick, room_id=room.occupantJID.userhost())) extra = {'info_type': ROOM_USER_LEFT,