Fixed typo, improved formatting. Thanks to @JarbasAI!
This commit is contained in:
@@ -1355,7 +1355,7 @@ class Client(object):
|
|||||||
thread_id, thread_type = getThreadIdAndThreadType(metadata)
|
thread_id, thread_type = getThreadIdAndThreadType(metadata)
|
||||||
self.onMessage(mid=mid, author_id=author_id, message=message,
|
self.onMessage(mid=mid, author_id=author_id, message=message,
|
||||||
thread_id=thread_id, thread_type=thread_type, ts=ts, metadata=metadata, msg=m)
|
thread_id=thread_id, thread_type=thread_type, ts=ts, metadata=metadata, msg=m)
|
||||||
|
|
||||||
# Unknown message type
|
# Unknown message type
|
||||||
else:
|
else:
|
||||||
self.onUnknownMesssageType(msg=m)
|
self.onUnknownMesssageType(msg=m)
|
||||||
@@ -1388,16 +1388,15 @@ class Client(object):
|
|||||||
# Is sent before any other message
|
# Is sent before any other message
|
||||||
elif mtype == "deltaflow":
|
elif mtype == "deltaflow":
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Chat timestamp
|
# Chat timestamp
|
||||||
elif mtype == "chatproxy-presence":
|
elif mtype == "chatproxy-presence":
|
||||||
buddyList = []
|
buddylist = {}
|
||||||
for id in m.get("buddyList", {}).keys():
|
for _id in m.get('buddyList', {}):
|
||||||
payload = m["buddyList"][id]
|
payload = m['buddyList'][_id]
|
||||||
timestamp = payload["lat"]
|
buddylist[_id] = payload.get('lat')
|
||||||
buddyList.append({id:timestamp})
|
self.onChatTimestamp(buddylist=buddylist, msg=m)
|
||||||
self.onChatTimestamp(buddylist=buddyList, msg=m)
|
|
||||||
|
|
||||||
# Unknown message type
|
# Unknown message type
|
||||||
else:
|
else:
|
||||||
self.onUnknownMesssageType(msg=m)
|
self.onUnknownMesssageType(msg=m)
|
||||||
@@ -1685,15 +1684,15 @@ class Client(object):
|
|||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def onChatTimestamp(self, buddylist={), msg={}):
|
def onChatTimestamp(self, buddylist={}, msg={}):
|
||||||
"""
|
"""
|
||||||
Called when the client receives chat online presence update
|
Called when the client receives chat online presence update
|
||||||
|
|
||||||
:param buddylist: A list of dicts with friend id and last seen timestamp
|
:param buddylist: A list of dicts with friend id and last seen timestamp
|
||||||
:param msg: A full set of the data recieved
|
:param msg: A full set of the data recieved
|
||||||
"""
|
"""
|
||||||
log.debug('Chat Timestamps received: {}'.format(buddylist))
|
log.debug('Chat Timestamps received: {}'.format(buddylist))
|
||||||
|
|
||||||
def onUnknownMesssageType(self, msg={}):
|
def onUnknownMesssageType(self, msg={}):
|
||||||
"""
|
"""
|
||||||
Called when the client is listening, and some unknown data was recieved
|
Called when the client is listening, and some unknown data was recieved
|
||||||
|
Reference in New Issue
Block a user