mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 14:35:27 +00:00
We now account for streams having users that
may be deleted. We do a couple things:
- use a loop instead of map
- only pass in users to hipchat_subscriber
- early-exit if there are not users
- skip owner/members logic for public streams
16 lines
436 B
Python
16 lines
436 B
Python
from typing import Any, Dict, Set
|
|
|
|
class SubscriberHandler:
|
|
def __init__(self) -> None:
|
|
self.stream_info = dict() # type: Dict[int, Set[int]]
|
|
|
|
def set_info(self,
|
|
stream_id: int,
|
|
users: Set[int]) -> None:
|
|
self.stream_info[stream_id] = users
|
|
|
|
def get_users(self,
|
|
stream_id: int) -> Set[int]:
|
|
users = self.stream_info[stream_id]
|
|
return users
|