don't take into account chatstate when message is delayed (offline message, ...). Fixes #1294

This commit is contained in:
Yann Leboulanger 2006-02-21 09:52:55 +00:00
parent 050cffac8a
commit e85c373a95
1 changed files with 12 additions and 9 deletions

View File

@ -386,14 +386,16 @@ class Connection:
encTag = None encTag = None
decmsg = '' decmsg = ''
invite = None invite = None
delayed = False
for xtag in xtags: for xtag in xtags:
if xtag.getNamespace() == common.xmpp.NS_ENCRYPTED: if xtag.getNamespace() == common.xmpp.NS_ENCRYPTED:
encTag = xtag encTag = xtag
break # invitations
#invitations
elif xtag.getNamespace() == common.xmpp.NS_MUC_USER and \ elif xtag.getNamespace() == common.xmpp.NS_MUC_USER and \
xtag.getTag('invite'): xtag.getTag('invite') and not encTag:
invite = xtag invite = xtag
elif xtag.getNamespace() == common.xmpp.NS_DELAY:
delayed = True
# FIXME: Msn transport (CMSN1.2.1 and PyMSN0.10) do NOT RECOMMENDED # FIXME: Msn transport (CMSN1.2.1 and PyMSN0.10) do NOT RECOMMENDED
# invitation # invitation
# stanza (MUC JEP) remove in 2007, as we do not do NOT RECOMMENDED # stanza (MUC JEP) remove in 2007, as we do not do NOT RECOMMENDED
@ -402,12 +404,13 @@ class Connection:
room_jid = xtag.getAttr('jid') room_jid = xtag.getAttr('jid')
self.dispatch('GC_INVITATION', (room_jid, frm, '', None)) self.dispatch('GC_INVITATION', (room_jid, frm, '', None))
return return
# chatstates - look for chatstate tags in a message # chatstates - look for chatstate tags in a message if not delayed
children = msg.getChildren() if not delayed:
for child in children: children = msg.getChildren()
if child.getNamespace() == 'http://jabber.org/protocol/chatstates': for child in children:
chatstate = child.getName() if child.getNamespace() == 'http://jabber.org/protocol/chatstates':
break chatstate = child.getName()
break
if encTag and USE_GPG: if encTag and USE_GPG:
#decrypt #decrypt