Skip to content

Commit

Permalink
Added handling of skip_announcement and incremented MQ version
Browse files Browse the repository at this point in the history
  • Loading branch information
kirgrim committed Jan 3, 2025
1 parent d2912d9 commit e6fb30b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion chatbot_core/v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,13 @@ def handle_kick_out(self, body: dict):
def handle_invite(self, body: dict):
"""Handles incoming request to chatbot"""
new_cid = body.pop('cid', None)
skip_announcement = body.pop('skip_announcement', False)
self.log.info(f'Received invitation to cid: {new_cid}')
if new_cid and not self.current_conversations.get(new_cid, None):
self.current_conversations[new_cid] = body
self.set_conversation_state(new_cid, ConversationState.IDLE)
self.send_announcement(f'{self.nick.split("-")[0]} joined', new_cid)
if not skip_announcement:
self.send_announcement(f'{self.nick.split("-")[0]} joined', new_cid)

def get_conversation_state(self, cid) -> ConversationState:
return self.current_conversations.get(cid, {}).get('state', ConversationState.IDLE)
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
click~=8.0
klat-connector==0.6.2a15
neon-mq-connector==0.7.2a8
neon-mq-connector>=0.7.2a9
neon_utils[network,sentry] >= 1.11.1a6
ovos-bus-client~=0.0.5
psutil~=5.7

0 comments on commit e6fb30b

Please sign in to comment.