From 476cd9a9a00a80b9a157b4692b7a30f01fcd39e3 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Mon, 23 May 2005 18:16:51 +0000 Subject: [PATCH] we can receive empty message (for ex for gc_subjects) --- src/common/connection.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index 8732d21bc..06e893e60 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -177,8 +177,6 @@ class Connection: def _messageCB(self, con, msg): """Called when we recieve a message""" msgtxt = msg.getBody() - if not msgtxt: # empty message - return mtype = msg.getType() tim = msg.getTimestamp() tim = time.strptime(tim, '%Y%m%dT%H:%M:%S') @@ -207,9 +205,13 @@ class Connection: if subject: self.dispatch('GC_SUBJECT', (str(msg.getFrom()), subject)) else: + if not msgtxt: # empty message + return self.dispatch('GC_MSG', (str(msg.getFrom()), msgtxt, tim)) gajim.logger.write('gc', msgtxt, str(msg.getFrom()), tim = tim) else: + if not msgtxt: # empty message + return gajim.logger.write('incoming', msgtxt, str(msg.getFrom()), tim = tim) self.dispatch('MSG', (str(msg.getFrom()), msgtxt, tim)) # END messageCB