diff options
author | John Smith <mrdoctorwho@gmail.com> | 2016-11-17 15:48:56 +0300 |
---|---|---|
committer | John Smith <mrdoctorwho@gmail.com> | 2016-11-17 15:48:56 +0300 |
commit | d77546bb403578bf4b4af722775c3eb9e40b1ecf (patch) | |
tree | 633a4b55f91a520437c5e475173ae9cd4f427e26 /modules/mod_groupchat_msg.py | |
parent | 8f370bfda4ba731ae3a76a4ce04a03882167cb7a (diff) |
Update chat's last_used field on a presence
Diffstat (limited to 'modules/mod_groupchat_msg.py')
-rw-r--r-- | modules/mod_groupchat_msg.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/mod_groupchat_msg.py b/modules/mod_groupchat_msg.py index 23223f0..77b9898 100644 --- a/modules/mod_groupchat_msg.py +++ b/modules/mod_groupchat_msg.py @@ -30,7 +30,6 @@ def incoming_message_handler(cl, msg): if not msg.getTimestamp() and body and destination == TransportID: user = Chat.getUserObject(source) creator, id, domain = Chat.getParts(source) - send = False owner_nickname = None if user: if source in getattr(user, "chats", {}): @@ -43,7 +42,7 @@ def incoming_message_handler(cl, msg): # If we don't and nick (as in settings) is tied to the chat, then we can determine who sent the message send = ((nick == owner_nickname and user.settings.tie_chat_to_nickname) or user.settings.force_vk_date_group) - createFakeChat(user, source) + chat = createFakeChat(user, source) if html and html.getTag("body"): logger.debug("groupchats: fetched xhtml image (jid: %s)" % source) try: @@ -56,7 +55,8 @@ def incoming_message_handler(cl, msg): if send: with user.sync: user.vk.sendMessage(body, id, "chat_id") - runDatabaseQuery("update groupchats set last_used=? where jid=?", (time.time(), source), set=True) + if chat.isUpdateRequired(): + updateLastUsed(chat) raise xmpp.NodeProcessed() |