Proper checking for XEP-0085, with workaround for the caps missing

problem. Same here, remove check to notexistant once we have fallback
to disco.
This commit is contained in:
js 2008-07-15 13:51:20 +00:00
parent 697aca8877
commit 151e7af63e
1 changed files with 14 additions and 5 deletions

View File

@ -1121,16 +1121,25 @@ class Connection(ConnectionHandlers):
# please note that the only valid tag inside a message containing a <body>
# tag is the active event
if chatstate is not None:
if (composing_xep == 'XEP-0085' or not composing_xep) and \
composing_xep != 'asked_once':
# XXX: Once we have fallback to disco,
# remove notexistant check
if ((composing_xep == 'XEP-0085' or not composing_xep) \
and composing_xep != 'asked_once') or \
(gajim.capscache.is_supported(contact,
xmpp.NS_CHATSTATES) and \
not gajim.capscache.is_supported(contact,
'notexistant')):
# XEP-0085
msg_iq.setTag(chatstate, namespace = common.xmpp.NS_CHATSTATES)
if composing_xep in ('XEP-0022', 'asked_once') or not composing_xep:
msg_iq.setTag(chatstate,
namespace = common.xmpp.NS_CHATSTATES)
if composing_xep in ('XEP-0022', 'asked_once') or \
not composing_xep:
# XEP-0022
chatstate_node = msg_iq.setTag('x',
namespace = common.xmpp.NS_EVENT)
if chatstate is 'composing' or msgtxt:
chatstate_node.addChild(name = 'composing')
chatstate_node.addChild(
name = 'composing')
if forward_from:
addresses = msg_iq.addChild('addresses',