From af1f9e08ad195d1cab721c68d96278f9403e3dd8 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Tue, 24 Oct 2017 10:47:42 +0100 Subject: Clean up the MAM example a bit. --- examples/mam.py | 6 +++--- 1 file 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() -- cgit v1.2.3