|
@@ -181,7 +181,7 @@ class CallBack(): |
|
@@ -181,7 +181,7 @@ class CallBack(): |
|
181
|
else:
|
181
|
else:
|
|
182
|
if thread_type == ThreadType.GROUP:
|
182
|
if thread_type == ThreadType.GROUP:
|
|
183
|
body['roomSender'] = author_id
|
183
|
body['roomSender'] = author_id
|
|
184
|
-
|
184
|
+ print(message_object)
|
|
185
|
if message_object.text:
|
185
|
if message_object.text:
|
|
186
|
body['content'] = message_object.text
|
186
|
body['content'] = message_object.text
|
|
187
|
self._notify_(type_="textMsg", client=client, body=body)
|
187
|
self._notify_(type_="textMsg", client=client, body=body)
|
|
@@ -225,6 +225,7 @@ class CallBack(): |
|
@@ -225,6 +225,7 @@ class CallBack(): |
|
225
|
self._notify_(type_="stickerMsg", client=client, body=body)
|
225
|
self._notify_(type_="stickerMsg", client=client, body=body)
|
|
226
|
else:
|
226
|
else:
|
|
227
|
print(message_object)
|
227
|
print(message_object)
|
|
|
|
228
|
+ self.onUnknownMesssageType(client=client, msg=msg)
|
|
228
|
|
229
|
|
|
229
|
if not self.queue:
|
230
|
if not self.queue:
|
|
230
|
client.markAsDelivered(thread_id, message_object.uid)
|
231
|
client.markAsDelivered(thread_id, message_object.uid)
|
|
@@ -1126,6 +1127,11 @@ class CallBack(): |
|
@@ -1126,6 +1127,11 @@ class CallBack(): |
|
1126
|
msg: A full set of the data received
|
1127
|
msg: A full set of the data received
|
|
1127
|
"""
|
1128
|
"""
|
|
1128
|
type_ = msg.get('type')
|
1129
|
type_ = msg.get('type')
|
|
|
|
1130
|
+ try:
|
|
|
|
1131
|
+ lwa_type = msg['attachments'][0]['mercury']['extensible_attachment']['story_attachment']['target'][
|
|
|
|
1132
|
+ 'lwa_type']
|
|
|
|
1133
|
+ except:
|
|
|
|
1134
|
+ lwa_type = None
|
|
1129
|
|
1135
|
|
|
1130
|
if type_ == 'jewel_friending_notifs':
|
1136
|
if type_ == 'jewel_friending_notifs':
|
|
1131
|
self.onFriendConfirmRequest(client)
|
1137
|
self.onFriendConfirmRequest(client)
|
|
@@ -1133,6 +1139,8 @@ class CallBack(): |
|
@@ -1133,6 +1139,8 @@ class CallBack(): |
|
1133
|
self.onAdminTextMessage(client, msg)
|
1139
|
self.onAdminTextMessage(client, msg)
|
|
1134
|
elif type_ == 'live_poke':
|
1140
|
elif type_ == 'live_poke':
|
|
1135
|
self.onLivePoke(client, msg)
|
1141
|
self.onLivePoke(client, msg)
|
|
|
|
1142
|
+ elif lwa_type == 'WAVE':
|
|
|
|
1143
|
+ self.onWavePoke(client, msg)
|
|
1136
|
else:
|
1144
|
else:
|
|
1137
|
log.debug("message : {}".format(msg))
|
1145
|
log.debug("message : {}".format(msg))
|
|
1138
|
|
1146
|
|
|
@@ -1186,6 +1194,25 @@ class CallBack(): |
|
@@ -1186,6 +1194,25 @@ class CallBack(): |
|
1186
|
}
|
1194
|
}
|
|
1187
|
self._notify_(type_="systemMsg", client=client, body=body)
|
1195
|
self._notify_(type_="systemMsg", client=client, body=body)
|
|
1188
|
|
1196
|
|
|
|
|
1197
|
+ def onWavePoke(self, client, msg):
|
|
|
|
1198
|
+ messageMetadata = msg['messageMetadata']
|
|
|
|
1199
|
+ attachments = msg['attachments'][0]
|
|
|
|
1200
|
+ image = attachments['mercury']['extensible_attachment']['story_attachment']['media']['image']
|
|
|
|
1201
|
+ description = attachments['mercury']['extensible_attachment']['story_attachment']['description']
|
|
|
|
1202
|
+ title_with_entities = attachments['mercury']['extensible_attachment']['story_attachment']['title_with_entities']
|
|
|
|
1203
|
+ body = {
|
|
|
|
1204
|
+ 'to': client.uid,
|
|
|
|
1205
|
+ 'from': messageMetadata['actorFbId'],
|
|
|
|
1206
|
+ 'content': title_with_entities['text'],
|
|
|
|
1207
|
+ 'image': image,
|
|
|
|
1208
|
+ 'description': description['text'],
|
|
|
|
1209
|
+ 'wave_time': messageMetadata['timestamp'],
|
|
|
|
1210
|
+ 'type': 'wave_poke',
|
|
|
|
1211
|
+ 'class': 'LightweightAction',
|
|
|
|
1212
|
+ 'msgId': messageMetadata['messageId']
|
|
|
|
1213
|
+ }
|
|
|
|
1214
|
+ self._notify_(type_="systemMsg", client=client, body=body)
|
|
|
|
1215
|
+
|
|
1189
|
def onWebNotice(self, client, kwargs):
|
1216
|
def onWebNotice(self, client, kwargs):
|
|
1190
|
self._notify_(type_="webNotice", client=client, body=kwargs)
|
1217
|
self._notify_(type_="webNotice", client=client, body=kwargs)
|
|
1191
|
if kwargs['notif_type'] == 'family_request':
|
1218
|
if kwargs['notif_type'] == 'family_request':
|