Add broadcast to non-admin function

This commit is contained in:
amcmanu3 2023-11-30 12:12:16 -05:00
parent fb41bc2443
commit b60e6933dd

View File

@ -43,6 +43,14 @@ class WebSocketManager(metaclass=Singleton):
self.broadcast_with_fn(filter_fn, event_type, data)
def broadcast_to_non_admins(self, event_type: str, data):
def filter_fn(client):
if str(client.get_user_id()) not in str(HelperUsers.get_super_user_list()):
return True
return False
self.broadcast_with_fn(filter_fn, event_type, data)
def broadcast_page(self, page: str, event_type: str, data):
def filter_fn(client):
return client.page == page