From 370865c2c1a6b9d5dc687b3cdff4af84a80fbfd0 Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Sun, 10 Apr 2022 05:07:41 -0400 Subject: [PATCH] Silently handle inbound "feed" messages They seem to be pure metadata, so don't post them as messages --- matrix_appservice_kakaotalk/portal.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/matrix_appservice_kakaotalk/portal.py b/matrix_appservice_kakaotalk/portal.py index 816ddf9..391328a 100644 --- a/matrix_appservice_kakaotalk/portal.py +++ b/matrix_appservice_kakaotalk/portal.py @@ -190,6 +190,7 @@ class Portal(DBPortal, BasePortal): # TODO More cls._chat_type_handler_map = { + KnownChatType.FEED: cls._handle_kakaotalk_feed, KnownChatType.TEXT: cls._handle_kakaotalk_text, KnownChatType.REPLY: cls._handle_kakaotalk_reply, KnownChatType.PHOTO: cls._handle_kakaotalk_photo, @@ -1103,6 +1104,15 @@ class Portal(DBPortal, BasePortal): events.append(await self._send_message(intent, content, timestamp=timestamp)) return events + async def _handle_kakaotalk_feed( + self, + timestamp: int, + chat_text: str | None, + **_ + ) -> list[EventID]: + self.log.info("Got feed message at %s: %s", timestamp, chat_text or "none") + return [] + async def _handle_kakaotalk_text( self, intent: IntentAPI,