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

github.com/mrDoctorWho/vk4xmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrDoctorWho <mrdoctorwho@gmail.com>2015-03-13 23:58:20 +0300
committermrDoctorWho <mrdoctorwho@gmail.com>2015-03-13 23:58:20 +0300
commit5e9e194ab1dfaf13503d9ebda8eceb2fca202884 (patch)
tree21c29c7f5d7f509600f4508a87c3008c6b737a01 /modules/mod_iq_disco.py
parenta80ae5448da369022481fe15e65b7fcd7ad64979 (diff)
Change simpleapps.ru to jabberon.ru
Fixed TypeError in groupchats.py in users list update Fixed retrying of groupchats creation in groupcahts.py (now it shouldn't start dozens of threads) Same as in groupchats as described in the line above fixed the same error in statustovk.py extension Fixed fake user deletion after captcha challenge was completed by a user Fixed transport freeze while working in longpoll Fixed transport freeze while sending a message or handling any method in the main thread Added feature to unload any module Vcard requests will be highly limited for the transport stability and such Most of the handlers were switched to threaded mode
Diffstat (limited to 'modules/mod_iq_disco.py')
-rw-r--r--modules/mod_iq_disco.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/mod_iq_disco.py b/modules/mod_iq_disco.py
index 882a3ed..b59a0a8 100644
--- a/modules/mod_iq_disco.py
+++ b/modules/mod_iq_disco.py
@@ -106,7 +106,7 @@ def checkAPIToken(token):
userID = vk.getUserID()
name = vk.getUserData(userID)
data = {"auth": auth, "name": name, "id": str(userID), "friends_count": len(vk.getFriends())}
- except Exception:
+ except (api.VkApiError, Exception):
data = wException()
return data
@@ -203,7 +203,6 @@ def commands_handler(cl, iq):
if form.get("token"):
token = form["token"]
_result = checkAPIToken(token)
- # {'friends_count': 5, 'name': {u'uid': 218855826, 'name': u'Some User', u'screen_name': u'some_user'}, 'auth': True, 'id': 218855826}
if isinstance(_result, dict):
_fields = dictToDataForm(_result)
@@ -273,3 +272,9 @@ def load():
Component.RegisterHandler("iq", disco_handler, "get", xmpp.NS_DISCO_INFO)
Component.RegisterHandler("iq", disco_handler, "get", xmpp.NS_DISCO_ITEMS)
Component.RegisterHandler("iq", commands_handler, "set")
+
+
+def unload():
+ Component.UnregisterHandler("iq", disco_handler, "get", xmpp.NS_DISCO_INFO)
+ Component.UnregisterHandler("iq", disco_handler, "get", xmpp.NS_DISCO_ITEMS)
+ Component.UnregisterHandler("iq", commands_handler, "set") \ No newline at end of file