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


Commits:
ebf79d1a by lovetox at 2022-05-09T21:07:51+02:00
fix: Don’t show unknown IQ errors

Seems some buggy server send IQ error with an unknown id. Log the error
but dont bother the user with it.

Fixes #10801

- - - - -


4 changed files:

- ChangeLog
- gajim/common/events.py
- gajim/common/modules/iq.py
- gajim/gui_interface.py


Changes:

=====================================
ChangeLog
=====================================
@@ -121,6 +121,7 @@ Gajim 1.4.0 (TBA)
   * #10751 Inconsistent notifications behavior in 1.4 nightlies
   * #10773 Failure to store roster notes not reported
   * #10774 AppIndicator should be used for the tray icon on Wayland
+  * #10801 Unknown IQ errors shown in chat
   * #10813 Receiving a notification creates exception
   * #10814 Unable to delete custom theme
   * #10815 Improve Security Labels (XEP-0258) feature


=====================================
gajim/common/events.py
=====================================
@@ -288,13 +288,6 @@ class DisplayedReceived(BaseChatMarkerEvent):
     name: str = field(init=False, default='displayed-received')
 
 
-@dataclass
-class IqErrorReceived(ApplicationEvent):
-    name: str = field(init=False, default='iq-error-received')
-    account: str
-    properties: Any
-
-
 @dataclass
 class HttpAuth(ApplicationEvent):
     name: str = field(init=False, default='http-auth')


=====================================
gajim/common/modules/iq.py
=====================================
@@ -20,7 +20,6 @@
 from gajim.common import app
 from gajim.common.events import FileRequestError
 from gajim.common.events import FileSendError
-from gajim.common.events import IqErrorReceived
 from gajim.common.helpers import to_user_string
 from gajim.common.file_props import FilesProp
 from gajim.common.modules.base import BaseModule
@@ -73,9 +72,9 @@ def _iq_error_received(self, _con, _stanza, properties):
                         file_props)
                     raise nbxmpp.NodeProcessed
 
-        app.ged.raise_event(
-            IqErrorReceived(account=self._account,
-                            properties=properties))
+        self._log.error('Received iq error with unknown id: %s',
+                        properties.error)
+
         raise nbxmpp.NodeProcessed
 
     @staticmethod


=====================================
gajim/gui_interface.py
=====================================
@@ -128,7 +128,6 @@ def __init__(self):
     def _create_core_handlers_list(self) -> None:
         # pylint: disable=line-too-long
         self.handlers = {
-            'iq-error-received': [self.handle_event_iq_error],
             'signed-in': [self.handle_event_signed_in],
             'presence-received': [self.handle_event_presence],
             'message-sent': [self.handle_event_msgsent],
@@ -154,12 +153,6 @@ def _register_core_handlers(self) -> None:
                     prio,
                     event_handler)
 
-    @staticmethod
-    def handle_event_iq_error(event):
-        ctrl = app.window.get_control(event.account, event.properties.jid.bare)
-        if ctrl and ctrl.is_groupchat:
-            ctrl.add_info_message(f'Error: {event.properties.error}')
-
     @staticmethod
     def handle_event_signed_in(event):
         """



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

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/ebf79d1a135377e3ef66138bcbe02fb733db4fe1
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