diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2017-10-24 10:47:42 +0100 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2017-10-24 10:47:42 +0100 |
commit | af1f9e08ad195d1cab721c68d96278f9403e3dd8 (patch) | |
tree | c9245452cc7fedb252529c665bdaf17d4eda3be0 /examples | |
parent | e3fd0af9c8ae6156276c94cdb4b27f96dfc22ea5 (diff) | |
download | slixmpp-af1f9e08ad195d1cab721c68d96278f9403e3dd8.tar.gz slixmpp-af1f9e08ad195d1cab721c68d96278f9403e3dd8.tar.bz2 slixmpp-af1f9e08ad195d1cab721c68d96278f9403e3dd8.tar.xz slixmpp-af1f9e08ad195d1cab721c68d96278f9403e3dd8.zip |
Clean up the MAM example a bit.
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/mam.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/mam.py b/examples/mam.py index 7d55645c..442d4516 100755 --- a/examples/mam.py +++ b/examples/mam.py @@ -38,13 +38,13 @@ class MAM(slixmpp.ClientXMPP): Fetch mam results for the specified JID. Use RSM to paginate the results. """ - iq = self.make_iq_get() results = self.plugin['xep_0313'].retrieve(jid=self.remote_jid, iterator=True, rsm={'max': 10}, start=self.start_date) page = 1 async for rsm in results: - print('Page %s' % page) + print('Page %d' % page) for msg in rsm['mam']['results']: - print('%s: %s' % (msg['mam_result']['forwarded']['stanza']['from'], msg['mam_result']['forwarded']['stanza']['body'])) + forwarded_stanza = msg['mam_result']['forwarded']['stanza'] + print('%s: %s' % (forwarded_stanza['from'], forwarded_stanza['body'])) page += 1 self.disconnect() |