From f100ab07aa88b47402c633ef49516f5520466d12 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Tue, 20 Oct 2020 16:18:36 +0000 Subject: [PATCH] jabber mirror: Remove code for occupy/vacate events. The server no longer sends occupy/vacate events for streams. The mirror should continue to work fine by processing subsription-related events. --- .../integrations/jabber/jabber_mirror_backend.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/zulip/integrations/jabber/jabber_mirror_backend.py b/zulip/integrations/jabber/jabber_mirror_backend.py index dfda56b..c93ccab 100755 --- a/zulip/integrations/jabber/jabber_mirror_backend.py +++ b/zulip/integrations/jabber/jabber_mirror_backend.py @@ -219,8 +219,6 @@ class ZulipToJabberBot: logging.exception("Exception forwarding Zulip => Jabber") elif event['type'] == 'subscription': self.process_subscription(event) - elif event['type'] == 'stream': - self.process_stream(event) def stream_message(self, msg: Dict[str, str]) -> None: assert(self.jabber is not None) @@ -266,19 +264,6 @@ class ZulipToJabberBot: for stream in streams: self.jabber.leave_muc(stream_to_room(stream)) - def process_stream(self, event: Dict[str, Any]) -> None: - assert(self.jabber is not None) - if event['op'] == 'occupy': - streams = [s['name'].lower() for s in event['streams']] - streams = [s for s in streams if s.endswith("/xmpp")] - for stream in streams: - self.jabber.join_muc(stream_to_room(stream)) - if event['op'] == 'vacate': - streams = [s['name'].lower() for s in event['streams']] - streams = [s for s in streams if s.endswith("/xmpp")] - for stream in streams: - self.jabber.leave_muc(stream_to_room(stream)) - def get_rooms(zulipToJabber: ZulipToJabberBot) -> List[str]: def get_stream_infos(key: str, method: Callable[[], Dict[str, Any]]) -> Any: ret = method()