MAM example: Also display the timestamp.
This commit is contained in:
parent
af1f9e08ad
commit
80b9cd43b1
@ -43,8 +43,10 @@ class MAM(slixmpp.ClientXMPP):
|
|||||||
async for rsm in results:
|
async for rsm in results:
|
||||||
print('Page %d' % page)
|
print('Page %d' % page)
|
||||||
for msg in rsm['mam']['results']:
|
for msg in rsm['mam']['results']:
|
||||||
forwarded_stanza = msg['mam_result']['forwarded']['stanza']
|
forwarded = msg['mam_result']['forwarded']
|
||||||
print('%s: %s' % (forwarded_stanza['from'], forwarded_stanza['body']))
|
timestamp = forwarded['delay']['stamp']
|
||||||
|
message = forwarded['stanza']
|
||||||
|
print('[%s] %s: %s' % (timestamp, message['from'], message['body']))
|
||||||
page += 1
|
page += 1
|
||||||
self.disconnect()
|
self.disconnect()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user