fix channel type check and parsing payload

This commit is contained in:
Morgan McMillian 2021-02-27 10:08:59 -08:00
parent 49fd79e882
commit 07ea679ecd

View file

@ -252,13 +252,14 @@ def on_message(ws, message):
if 'data' in msg:
if msg['meta']['type'] == "message":
if 'channel_type' in msg['meta']:
# TODO: bypassed other channel types for now
if msg['meta']['channel_type'] != 'io.pnut.core.chat':
return
pmsg = pnutpy.models.Message.from_response_data(msg['data'])
for d_item in msg['data']:
pmsg = pnutpy.models.Message.from_response_data(d_item)
if 'is_deleted' in msg['meta']:
if msg['meta']['is_deleted']: