From bed0dbf998be11c4237bf2c9e263356ea78e3e10 Mon Sep 17 00:00:00 2001 From: miruka Date: Mon, 23 Mar 2020 16:58:31 -0400 Subject: [PATCH] Add setting to ignore unknown events --- src/backend/nio_callbacks.py | 4 ++++ src/backend/user_files.py | 1 + 2 files changed, 5 insertions(+) diff --git a/src/backend/nio_callbacks.py b/src/backend/nio_callbacks.py index 0b262cd9..f3565c1c 100644 --- a/src/backend/nio_callbacks.py +++ b/src/backend/nio_callbacks.py @@ -380,6 +380,10 @@ class NioCallbacks: async def onUnknownEvent(self, room, ev) -> None: + if self.client.backend.ui_settings["hideUnknownEvents"]: + self.client.skipped_events[room.room_id] += 1 + return + co = f"%1 sent an unsupported {ev.type} event" await self.client.register_nio_event(room, ev, content=co) diff --git a/src/backend/user_files.py b/src/backend/user_files.py index 65e96023..0eb58205 100644 --- a/src/backend/user_files.py +++ b/src/backend/user_files.py @@ -214,6 +214,7 @@ class UISettings(JSONDataFile): "collapseSidePanesUnderWindowWidth": 400, "hideProfileChangeEvents": True, "hideMembershipEvents": False, + "hideUnknownEvents": False, "theme": "Midnight.qpl", "writeAliases": {}, "media": {