summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_proto.cpp
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2014-09-04 10:31:44 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2014-09-04 10:31:44 +0000
commit737038f45d00ebe16f57d7fb38e4ffa8793b3fde (patch)
treee39c8dfa16016b57d06a1eb58073958910dd9825 /protocols/VKontakte/src/vk_proto.cpp
parent12227286ce79b9283daced6d1b8b6e1a5f285d55 (diff)
VKontakte:
Typing support Add mark read on typing option git-svn-id: http://svn.miranda-ng.org/main/trunk@10366 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_proto.cpp')
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp
index f08e004b08..d2191bc4b2 100644
--- a/protocols/VKontakte/src/vk_proto.cpp
+++ b/protocols/VKontakte/src/vk_proto.cpp
@@ -56,6 +56,7 @@ CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) :
m_bHideChats = getBool("HideChats", true);
m_bMesAsUnread = getBool("MesAsUnread", false);
m_bMarkReadOnReply = getBool("MarkReadOnReply", false);
+ m_bMarkReadOnTyping = getBool("MarkReadOnTyping", false) && m_bMarkReadOnReply;
m_bAutoSyncHistory = getBool("AutoSyncHistory", true);
// Set all contacts offline -- in case we crashed
@@ -322,7 +323,20 @@ int CVkProto::AuthDeny(HANDLE hDbEvent, const PROTOCHAR *reason)
int CVkProto::UserIsTyping(MCONTACT hContact, int type)
{
- return 0;
+ if (PROTOTYPE_SELFTYPING_ON == type) {
+ LONG userID = getDword(hContact, "ID", -1);
+ if ((userID == -1)||(!IsOnline()))
+ return 1;
+
+ if (m_bMarkReadOnTyping)
+ MarkMessagesRead(hContact);
+
+ Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/messages.setActivity.json", true, &CVkProto::OnReceiveSmth)
+ << INT_PARAM("user_id", userID)
+ << CHAR_PARAM("type", "typing"));
+ return 0;
+ }
+ return 1;
}
MCONTACT CVkProto::AddToListByEvent(int flags,int iContact,HANDLE hDbEvent)