support red envelope

This commit is contained in:
Yuxin Wu
2016-06-17 23:20:08 -07:00
parent 1344589d8d
commit 98cc7c7fc8
+5
View File
@@ -15,6 +15,7 @@ TYPE_VOIP = 50
TYPE_WX_VIDEO = 62 # video took by wechat
TYPE_SYSTEM = 10000
TYPE_CUSTOM_EMOJI = 1048625
TYPE_REDENVELOPE = 436207665
TYPE_LOCATION_SHARING = -1879048186
TYPE_APP_MSG = 16777265
@@ -88,6 +89,10 @@ class WeChatMsg(object):
elif self.type == TYPE_EMOJI:
# TODO add emoji name
return self.content
elif self.type == TYPE_REDENVELOPE:
pq = PyQuery(self.content_xml_ready, parser='xml')
title = pq('sendertitle').text()
return u"[RED ENVELOPE]\n{}".format(title)
else:
# TODO replace smiley with text
return self.content