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


Commits:
a298bf1c by Philipp Hörist at 2019-10-23T20:09:50Z
Receipts: Don't request receipt in groupchat

- - - - -
bfc49cbf by Philipp Hörist at 2019-10-24T20:56:15Z
Don't stop processing messages after receiving non-active chatstate

Some client implement not recommended behavior and send other chatstates
than active including a <body>

- - - - -


2 changed files:

- gajim/common/connection.py
- gajim/common/modules/chatstates.py


Changes:

=====================================
gajim/common/connection.py
=====================================
@@ -296,7 +296,7 @@ class CommonConnection:
 
             # XEP-0184
             if obj.jid != app.get_jid_from_account(self.name):
-                if obj.message:
+                if obj.message and obj.type_ != 'groupchat':
                     msg_iq.setReceiptRequest()
 
             if obj.session:


=====================================
gajim/common/modules/chatstates.py
=====================================
@@ -137,7 +137,7 @@ class Chatstate(BaseModule):
                          account=self._account,
                          contact=contact))
 
-    def _process_chatstate(self, _con, _stanza, properties):
+    def _process_chatstate(self, _con, stanza, properties):
         if not properties.has_chatstate:
             return
 
@@ -168,7 +168,13 @@ class Chatstate(BaseModule):
                          contact=contact))
 
         if properties.chatstate in ('inactive', 'gone', 'composing', 'paused'):
-            raise nbxmpp.NodeProcessed
+            if properties.body is None:
+                # So we dont lose a message if a client implements not
+                # recomended behavior
+                raise nbxmpp.NodeProcessed
+
+            self._log.warning('Chatstate with body received')
+            self._log.warning(stanza)
 
     @ensure_enabled
     def _check_last_interaction(self) -> GLib.SOURCE_CONTINUE:



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/compare/234480956029929a44ffd28e6832d95db0b9e0db...bfc49cbf6f71c9de1509278a3854242c0f8855ef

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/compare/234480956029929a44ffd28e6832d95db0b9e0db...bfc49cbf6f71c9de1509278a3854242c0f8855ef
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to