Merge pull request #172 from JarbasAI/patch-1
Add on chat presence event
This commit is contained in:
@@ -1389,6 +1389,15 @@ class Client(object):
|
|||||||
elif mtype == "deltaflow":
|
elif mtype == "deltaflow":
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# Chat timestamp
|
||||||
|
elif mtype == "chatproxy-presence":
|
||||||
|
buddyList = []
|
||||||
|
for id in m.get("buddyList", {}).keys():
|
||||||
|
payload = m["buddyList"][id]
|
||||||
|
timestamp = payload["lat"]
|
||||||
|
buddyList.append({id:timestamp})
|
||||||
|
self.onChatTimestamp(buddylist=buddyList, msg=m)
|
||||||
|
|
||||||
# Unknown message type
|
# Unknown message type
|
||||||
else:
|
else:
|
||||||
self.onUnknownMesssageType(msg=m)
|
self.onUnknownMesssageType(msg=m)
|
||||||
@@ -1676,6 +1685,14 @@ class Client(object):
|
|||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def onChatTimestamp(self, buddylist={), msg={}):
|
||||||
|
"""
|
||||||
|
Called when the client receives chat online presence update
|
||||||
|
|
||||||
|
:param buddylist: A list of dicts with friend id and last seen timestamp
|
||||||
|
:param msg: A full set of the data recieved
|
||||||
|
"""
|
||||||
|
log.debug('Chat Timestamps received: {}'.format(buddylist))
|
||||||
|
|
||||||
def onUnknownMesssageType(self, msg={}):
|
def onUnknownMesssageType(self, msg={}):
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user