From 62a7bb9bc5069310a38c52d5f44d2a61267eed2c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 5 Jun 2018 13:55:23 +0300 Subject: =?UTF-8?q?VKontakte:=20fix=20#1392=20(access=20denied=20on=20typi?= =?UTF-8?q?ng=20for=20banned=20contacts)=20fix=20=E2=80=98=3F=E2=80=99=20i?= =?UTF-8?q?n=20avatar=20filenames?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fingerprint: fixed Conversations detect --- plugins/FingerprintNG/src/masks.cpp | 4 ++-- protocols/VKontakte/src/misc.cpp | 4 +++- protocols/VKontakte/src/version.h | 2 +- protocols/VKontakte/src/vk_avatars.cpp | 7 ++++++- protocols/VKontakte/src/vk_proto.cpp | 3 +++ 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/plugins/FingerprintNG/src/masks.cpp b/plugins/FingerprintNG/src/masks.cpp index 6c5fc80dac..557937b4f7 100644 --- a/plugins/FingerprintNG/src/masks.cpp +++ b/plugins/FingerprintNG/src/masks.cpp @@ -1,4 +1,4 @@ -/* +/* Fingerprint NG (client version) icons module for Miranda NG Copyright © 2006-18 ghazan, mataes, HierOS, FYR, Bio, nullbie, faith_healer and all respective contributors. @@ -238,7 +238,7 @@ KN_FP_MASK def_kn_fp_mask[] = { "client_Colloquy", L"Colloquy*", L"Colloquy", IDI_COLLOQUY, JABBER_CASE, TRUE }, { "client_CommuniGate", L"*CommuniGate*", L"CommuniGate Pro", IDI_COMMUNIGATE, JABBER_CASE, TRUE }, { "client_Conference", L"Conference*", L"Conference Bot (GMail)", IDI_CONFERENCE, JABBER_CASE, TRUE }, - { "client_Conversations", L"*http://conversations.im*", L"Conversations", IDI_CONVERSATIONS, JABBER_CASE, TRUE }, + { "client_Conversations", L"*http://conversations.im*|Conversations IM*", L"Conversations", IDI_CONVERSATIONS, JABBER_CASE, TRUE }, { "client_Crosstalk", L"*Cross*talk*", L"Crosstalk", IDI_CROSSTALK, JABBER_CASE, TRUE }, { "client_Cudumar", L"*Cudumar*", L"Cudumar", IDI_CUDUMAR, JABBER_CASE, TRUE }, { "client_CyclopsChat", L"*Cyclops*", L"Cyclops Chat", IDI_CYCLOPS_CHAT, JABBER_CASE, TRUE }, diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 79e9066c07..5330ddec60 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -283,7 +283,9 @@ bool CVkProto::CheckJsonResult(AsyncHttpRequest *pReq, const JSONNode &jnNode) ConnectionFailed(LOGINERR_WRONGPASSWORD); break; case VKERR_ACCESS_DENIED: - if (jnError["error_msg"] && jnError["error_msg"].as_mstring() == L"Access denied: can't set typing activity for this peer") { + if ((jnError["error_msg"] && jnError["error_msg"].as_mstring() == L"Access denied: can't set typing activity for this peer") + || (pReq->m_szUrl.Find("messages.setActivity.json") > -1) + ) { debugLogA("CVkProto::CheckJsonResult VKERR_ACCESS_DENIED (can't set typing activity) - ignore"); break; } diff --git a/protocols/VKontakte/src/version.h b/protocols/VKontakte/src/version.h index 43d4d0ecbd..a566618bc3 100644 --- a/protocols/VKontakte/src/version.h +++ b/protocols/VKontakte/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 1 #define __RELEASE_NUM 5 -#define __BUILD_NUM 1 +#define __BUILD_NUM 2 #include diff --git a/protocols/VKontakte/src/vk_avatars.cpp b/protocols/VKontakte/src/vk_avatars.cpp index af7e9680f4..64d8d53a3d 100644 --- a/protocols/VKontakte/src/vk_avatars.cpp +++ b/protocols/VKontakte/src/vk_avatars.cpp @@ -141,9 +141,14 @@ void CVkProto::GetAvatarFileName(MCONTACT hContact, wchar_t *pwszDest, size_t cb const wchar_t *szFileType = L".jpg"; ptrW wszUrl(getWStringA(hContact, "AvatarUrl")); if (wszUrl) { - wchar_t *p = wcsrchr(wszUrl, '.'); + wchar_t *p = wcschr(wszUrl, '?'); + if (p != nullptr) + *p = 0; + + p = wcsrchr(wszUrl, '.'); if (p != nullptr) szFileType = p; + } LONG id = getDword(hContact, "ID", VK_INVALID_USER); diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index e8325d3d41..46582b8e90 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -624,6 +624,9 @@ int CVkProto::UserIsTyping(MCONTACT hContact, int type) if (userID == VK_INVALID_USER || !IsOnline() || userID == VK_FEED_USER) return 1; + if (!IsEmpty(ptrW(db_get_wsa(hContact, m_szModuleName, "Deactivated")))) + return 1; + if (m_vkOptions.iMarkMessageReadOn == MarkMsgReadOn::markOnTyping) MarkMessagesRead(hContact); -- cgit v1.2.3