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:
Diffstat (limited to 'modules/mod_msg_main.py')
-rw-r--r--modules/mod_msg_main.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/mod_msg_main.py b/modules/mod_msg_main.py
index 335ccd2..e844951 100644
--- a/modules/mod_msg_main.py
+++ b/modules/mod_msg_main.py
@@ -68,7 +68,8 @@ def message_handler_threaded(cl, msg):
if msg.getTag("composing"):
target = vk2xmpp(destination)
if target != TransportID:
- user.vk.method("messages.setActivity", {"user_id": target, "type": "typing"}, True)
+ with user.sync:
+ user.vk.method("messages.setActivity", {"user_id": target, "type": "typing"}, True)
if body:
answer = None
@@ -83,9 +84,9 @@ def message_handler_threaded(cl, msg):
else:
uID = jidTo.getNode()
- vkMessage = user.vk.sendMessage(body, uID)
- if vkMessage:
- answer = reportReceived(msg, jidFrom, jidTo)
+ with user.sync:
+ if user.vk.sendMessage(body, uID):
+ answer = reportReceived(msg, jidFrom, jidTo)
if answer:
sender(cl, answer)
executeHandlers("msg02", (msg,))