when a message a no type, we must consider it as type=normal as explained in RFC3921
This commit is contained in:
parent
a0df80aed6
commit
c3670ea4eb
|
@ -365,7 +365,14 @@ class Connection:
|
||||||
return
|
return
|
||||||
self.dispatch('GC_MSG', (frm, msgtxt, tim))
|
self.dispatch('GC_MSG', (frm, msgtxt, tim))
|
||||||
gajim.logger.write('gc_msg', frm, msgtxt, tim = tim)
|
gajim.logger.write('gc_msg', frm, msgtxt, tim = tim)
|
||||||
elif mtype == 'normal': # it's single message
|
elif mtype == 'chat': # it's type 'chat'
|
||||||
|
if not msg.getTag('body') and chatstate is None: #no <body>
|
||||||
|
return
|
||||||
|
if msg.getTag('body'):
|
||||||
|
gajim.logger.write('chat_msg_recv', frm, msgtxt, tim = tim, subject = subject)
|
||||||
|
self.dispatch('MSG', (frm, msgtxt, tim, encrypted, mtype, subject,
|
||||||
|
chatstate))
|
||||||
|
else: # it's single message
|
||||||
gajim.logger.write('single_msg_recv', frm, msgtxt, tim = tim, subject = subject)
|
gajim.logger.write('single_msg_recv', frm, msgtxt, tim = tim, subject = subject)
|
||||||
if invite is not None:
|
if invite is not None:
|
||||||
item = invite.getTag('invite')
|
item = invite.getTag('invite')
|
||||||
|
@ -377,13 +384,6 @@ class Connection:
|
||||||
else:
|
else:
|
||||||
self.dispatch('MSG', (frm, msgtxt, tim, encrypted, mtype, subject,
|
self.dispatch('MSG', (frm, msgtxt, tim, encrypted, mtype, subject,
|
||||||
None))
|
None))
|
||||||
else: # it's type 'chat'
|
|
||||||
if not msg.getTag('body') and chatstate is None: #no <body>
|
|
||||||
return
|
|
||||||
if msg.getTag('body'):
|
|
||||||
gajim.logger.write('chat_msg_recv', frm, msgtxt, tim = tim, subject = subject)
|
|
||||||
self.dispatch('MSG', (frm, msgtxt, tim, encrypted, mtype, subject,
|
|
||||||
chatstate))
|
|
||||||
# END messageCB
|
# END messageCB
|
||||||
|
|
||||||
def _presenceCB(self, con, prs):
|
def _presenceCB(self, con, prs):
|
||||||
|
|
Loading…
Reference in New Issue