messages stanza without <body> field are not printed
This commit is contained in:
parent
5494b24782
commit
cb0368ae09
1 changed files with 2 additions and 4 deletions
|
@ -186,6 +186,8 @@ class Connection:
|
||||||
def _messageCB(self, con, msg):
|
def _messageCB(self, con, msg):
|
||||||
"""Called when we recieve a message"""
|
"""Called when we recieve a message"""
|
||||||
msgtxt = msg.getBody()
|
msgtxt = msg.getBody()
|
||||||
|
if not msg.getTag('body'): #no <body>
|
||||||
|
return
|
||||||
mtype = msg.getType()
|
mtype = msg.getType()
|
||||||
tim = msg.getTimestamp()
|
tim = msg.getTimestamp()
|
||||||
tim = time.strptime(tim, '%Y%m%dT%H:%M:%S')
|
tim = time.strptime(tim, '%Y%m%dT%H:%M:%S')
|
||||||
|
@ -214,13 +216,9 @@ class Connection:
|
||||||
if subject:
|
if subject:
|
||||||
self.dispatch('GC_SUBJECT', (str(msg.getFrom()), subject))
|
self.dispatch('GC_SUBJECT', (str(msg.getFrom()), subject))
|
||||||
else:
|
else:
|
||||||
if not msgtxt: # empty message
|
|
||||||
return
|
|
||||||
self.dispatch('GC_MSG', (str(msg.getFrom()), msgtxt, tim))
|
self.dispatch('GC_MSG', (str(msg.getFrom()), msgtxt, tim))
|
||||||
gajim.logger.write('gc', msgtxt, str(msg.getFrom()), tim = tim)
|
gajim.logger.write('gc', msgtxt, str(msg.getFrom()), tim = tim)
|
||||||
else:
|
else:
|
||||||
if not msgtxt: # empty message
|
|
||||||
return
|
|
||||||
gajim.logger.write('incoming', msgtxt, str(msg.getFrom()), tim = tim)
|
gajim.logger.write('incoming', msgtxt, str(msg.getFrom()), tim = tim)
|
||||||
self.dispatch('MSG', (str(msg.getFrom()), msgtxt, tim))
|
self.dispatch('MSG', (str(msg.getFrom()), msgtxt, tim))
|
||||||
# END messageCB
|
# END messageCB
|
||||||
|
|
Loading…
Add table
Reference in a new issue