Skip to content

Commit

Permalink
message_handler -> event_handler
Browse files Browse the repository at this point in the history
  • Loading branch information
SaladDais committed Dec 19, 2023
1 parent 28e84c0 commit 7fafb8b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions hippolyzer/lib/voice/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,18 @@ def __init__(self, host, port):

self.vivox_conn: Optional[VivoxConnection] = None
self._poll_task = asyncio.create_task(self._poll_messages())
self.message_handler: MessageHandler[VivoxMessage, str] = MessageHandler(take_by_default=False)
self.event_handler: MessageHandler[VivoxMessage, str] = MessageHandler(take_by_default=False)

self.message_handler.subscribe(
self.event_handler.subscribe(
"VoiceServiceConnectionStateChangedEvent",
self._handle_voice_service_connection_state_changed
)
self.message_handler.subscribe("AccountLoginStateChangeEvent", self._handle_account_login_state_change)
self.message_handler.subscribe("SessionAddedEvent", self._handle_session_added)
self.message_handler.subscribe("SessionRemovedEvent", self._handle_session_removed)
self.message_handler.subscribe("ParticipantAddedEvent", self._handle_participant_added)
self.message_handler.subscribe("ParticipantUpdatedEvent", self._handle_participant_updated)
self.message_handler.subscribe("ParticipantRemovedEvent", self._handle_participant_removed)
self.event_handler.subscribe("AccountLoginStateChangeEvent", self._handle_account_login_state_change)
self.event_handler.subscribe("SessionAddedEvent", self._handle_session_added)
self.event_handler.subscribe("SessionRemovedEvent", self._handle_session_removed)
self.event_handler.subscribe("ParticipantAddedEvent", self._handle_participant_added)
self.event_handler.subscribe("ParticipantUpdatedEvent", self._handle_participant_updated)
self.event_handler.subscribe("ParticipantRemovedEvent", self._handle_participant_removed)

@property
def username(self):
Expand Down Expand Up @@ -367,7 +367,7 @@ async def _poll_messages(self):
try:
RESP_LOG.debug(repr(msg))
if msg.type == "Event":
self.message_handler.handle(msg)
self.event_handler.handle(msg)
elif msg.type == "Response":
# Might not have this request ID if it was sent directly via the socket
if msg.request_id in self._pending_req_futures:
Expand Down

0 comments on commit 7fafb8b

Please sign in to comment.