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