Skip to content

Commit e14bd1c

Browse files
Rishabh Chaturvedirishabh-chaturvedi
Rishabh Chaturvedi
authored andcommitted
Streaming event logs fixed
1 parent 9434896 commit e14bd1c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

symbl/streaming_api/StreamingConnection.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ def __listen_to_events(self, data):
3838
try:
3939
decoded_data = data if type(data) == str else data.decode('utf-8')
4040
json_data = json.loads(decoded_data)
41-
if 'type' in json_data and json_data['type'] == 'message' and 'data' in json_data['message'] and 'conversationId' in json_data['message']['data']:
41+
if 'type' in json_data and json_data['type'] == 'message' and 'type' in json_data['message'] and json_data['message']['type'] == "conversation_created":
4242
self.__set_conversation(str(json_data['message']['data']['conversationId']))
4343
Log.getInstance().info("Conversation id is {}".format(str(json_data['message']['data']['conversationId'])))
44+
elif 'type' in json_data and json_data['type'] == 'message' and 'type' in json_data['message'] and json_data['message']['type'] == "started_listening":
4445
Log.getInstance().info("Started Listening...")
4546
elif 'type' in json_data and json_data['type'] in self.event_callbacks:
4647
self.event_callbacks[json_data['type']](json_data)

0 commit comments

Comments
 (0)