From e0b71393adb6a90d278577d062655d0d9ebf616c Mon Sep 17 00:00:00 2001 From: ElzorFox Date: Thu, 23 Nov 2023 08:53:57 +0500 Subject: VKontakte: Contact::Readonly support version bump --- protocols/VKontakte/src/version.h | 2 +- protocols/VKontakte/src/vk_feed.cpp | 1 + protocols/VKontakte/src/vk_messages.cpp | 6 ++++++ protocols/VKontakte/src/vk_thread.cpp | 4 +++- 4 files changed, 11 insertions(+), 2 deletions(-) (limited to 'protocols') diff --git a/protocols/VKontakte/src/version.h b/protocols/VKontakte/src/version.h index b198d6705d..a59d576a65 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 15 -#define __BUILD_NUM 0 +#define __BUILD_NUM 1 #include diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp index 0edfe1851d..c5e6701ef1 100644 --- a/protocols/VKontakte/src/vk_feed.cpp +++ b/protocols/VKontakte/src/vk_feed.cpp @@ -44,6 +44,7 @@ void CVkProto::AddFeedSpecialUser() setWord(hContact, "Status", ID_STATUS_ONLINE); SetMirVer(hContact, 7); + Contact::Readonly(hContact); } void CVkProto::AddFeedEvent(CVKNewsItem& vkNewsItem) diff --git a/protocols/VKontakte/src/vk_messages.cpp b/protocols/VKontakte/src/vk_messages.cpp index 9e2a49c8b1..14a7027d4c 100644 --- a/protocols/VKontakte/src/vk_messages.cpp +++ b/protocols/VKontakte/src/vk_messages.cpp @@ -488,6 +488,12 @@ void CVkProto::OnReceiveDlgs(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) if (m_vkOptions.iMarkMessageReadOn == MarkMsgReadOn::markOnReceive) MarkMessagesRead(hContact); } + + const JSONNode& jnCanWrite = jnConversation["can_write"]; + + if (jnConversation["can_write"] && jnConversation["can_write"]["allowed"]) + Contact::Readonly(hContact, !jnConversation["can_write"]["allowed"].as_bool()); + } lufUsers.destroy(); RetrieveUsersInfo(); diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 7fb16b653e..c7a1e5259d 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -475,8 +475,10 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool bFlag, VKContactT setWString(hContact, "Deactivated", wszValue); } - if (!wszValue.IsEmpty()) + if (!wszValue.IsEmpty()) { + Contact::Readonly(hContact); return hContact; + } int sex = jnItem["sex"].as_int(); if (sex) -- cgit v1.2.3