From e3485cc2b3df1d61ffdd1aebc1b235a9aa8c62b7 Mon Sep 17 00:00:00 2001 From: Madhur Garg Date: Thu, 8 Aug 2019 17:12:19 +0530 Subject: Changed the check on an empty message because the earlier one might leave an empty body in XML representation. --- poezio/mam.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'poezio') diff --git a/poezio/mam.py b/poezio/mam.py index 163e6439..b5ef7206 100644 --- a/poezio/mam.py +++ b/poezio/mam.py @@ -84,7 +84,8 @@ async def query(self, remote_jid, start, end, top): async for rsm in results: if top: for msg in rsm['mam']['results']: - if msg['mam_result']['forwarded']['stanza']['body'] is not '': + if msg['mam_result']['forwarded']['stanza'].xml.find( + '{%s}%s' % ('jabber:client', 'body')) is not None: msgs.append(msg) if msg_count == 10: self.query_id = 0 -- cgit v1.2.3