Philipp Hörist pushed to branch master at gajim / gajim


Commits:
c5c42f9f by Philipp Hörist at 2025-03-16T12:24:34+01:00
fix: MUC: Don’t fail on presence from bare jids

Fixes #12232

- - - - -


1 changed file:

- gajim/common/modules/muc.py


Changes:

=====================================
gajim/common/modules/muc.py
=====================================
@@ -574,6 +574,7 @@ def _on_muc_user_presence(self,
                               properties: PresenceProperties
                               ) -> None:
 
+        assert properties.type is not None
         assert properties.muc_jid is not None
         room_jid = properties.muc_jid
         if room_jid not in self._mucs:
@@ -693,14 +694,14 @@ def _on_muc_user_presence(self,
             # unavailable presence, because we left the MUC
             return
 
+        if properties.jid.resource is None:
+            # prosody allows broadcasting "unavailable" presences from
+            # offline room members
+            return
+
         try:
             presence = self._process_user_presence(properties)
         except KeyError:
-            if (properties.type.is_unavailable
-                    and properties.muc_user.role.is_none):
-                # prosody allows broadcasting "unavailable" presences from
-                # offline room members
-                return
             # Sometimes it seems to happen that we get unavailable presence
             # from occupants we don’t know
             log.warning('Unexpected presence received')



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/c5c42f9ffef90981a6a2ca0c99fe5e1c8cd76e07

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/c5c42f9ffef90981a6a2ca0c99fe5e1c8cd76e07
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to