mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	import: Move SubscriberHandler to import_util.
This commit is contained in:
		@@ -19,6 +19,20 @@ from zerver.lib.parallel import run_parallel
 | 
			
		||||
# stubs
 | 
			
		||||
ZerverFieldsT = Dict[str, Any]
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
 | 
			
		||||
def build_zerver_realm(realm_id: int, realm_subdomain: str, time: float,
 | 
			
		||||
                       other_product: str) -> List[ZerverFieldsT]:
 | 
			
		||||
    realm = Realm(id=realm_id, date_created=time,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user