Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/isida/3.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiSabler <dissy@ya.ru>2013-09-23 20:42:09 +0400
committerdiSabler <dissy@ya.ru>2013-09-23 20:42:09 +0400
commit275faf7551dfba48c28d768d164416585cc5d6b3 (patch)
tree7a0278c6db35cee5a8536ce7643323dd4c43b516
parent88f9b1ec89a9de7bd1df350f4834571945751424 (diff)
add: type of caps
-rw-r--r--kernel.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel.py b/kernel.py
index 56f7df8..73c5839 100644
--- a/kernel.py
+++ b/kernel.py
@@ -1238,12 +1238,19 @@ def presenceCB(sess,mess):
except: id_node,hash_error = get_eval_item(mess,'getTag("c",namespace=xmpp.NS_CAPS).getAttr("node")'),True
try: id_ver = get_eval_item(mess,'getTag("c",namespace=xmpp.NS_CAPS).getAttr("ver")').decode('utf-8')
except: id_ver,hash_error = get_eval_item(mess,'getTag("c",namespace=xmpp.NS_CAPS).getAttr("ver")'),True
+ try: id_hash = get_eval_item(mess,'getTag("c",namespace=xmpp.NS_CAPS).getAttr("hash")').decode('utf-8')
+ except: id_hash,hash_error = get_eval_item(mess,'getTag("c",namespace=xmpp.NS_CAPS).getAttr("hash")'),True
+ try: id_ext = get_eval_item(mess,'getTag("c",namespace=xmpp.NS_CAPS).getAttr("ext")').decode('utf-8')
+ except: id_ext,hash_error = get_eval_item(mess,'getTag("c",namespace=xmpp.NS_CAPS).getAttr("ext")'),True
try:
id_bmver = mess.getAttr('ver').decode('utf-8')
if id_bmver or id_bmver == '': id_bmver = '%s_' % id_bmver
else: id_bmver = ''
except: id_bmver = ''
- capses['%s/%s' % (room,nick)] = '%s\n%s\n%s' % (id_node,id_ver,id_bmver)
+ if id_ext and id_hash: id_hash = '%s|%s' % (id_hash,id_ext)
+ elif id_ext: id_hash = id_ext
+ if id_hash: capses['%s/%s' % (room,nick)] = '%s\n%s [%s]\n%s' % (id_node,id_ver,id_hash,id_bmver)
+ else: capses['%s/%s' % (room,nick)] = '%s\n%s\n%s' % (id_node,id_ver,id_bmver)
# Hash control
if '%s|%s' % (role,affiliation) in levl and levl['%s|%s' % (role,affiliation)] <= 3: