Skip to content

Commit

Permalink
jabber mirror: Remove code for occupy/vacate events.
Browse files Browse the repository at this point in the history
The server no longer sends occupy/vacate events
for streams.

The mirror should continue to work fine by processing
subsription-related events.
  • Loading branch information
showell authored and timabbott committed Oct 20, 2020
1 parent befbb95 commit f100ab0
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions zulip/integrations/jabber/jabber_mirror_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,6 @@ def process_event(self, event: Dict[str, Any]) -> None:
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)
Expand Down Expand Up @@ -266,19 +264,6 @@ def process_subscription(self, event: Dict[str, Any]) -> None:
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()
Expand Down

0 comments on commit f100ab0

Please sign in to comment.