Files
zulip/zerver/data_import/hipchat_subscriber.py
Steve Howell bd1e96cf63 hipchat: Rework stream/subscriber logic.
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
2018-11-26 16:37:30 -08:00

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