summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/misc.cpp
diff options
context:
space:
mode:
authorElzorFox <elzorfox@ya.ru>2023-12-07 13:51:23 +0500
committerElzorFox <elzorfox@ya.ru>2023-12-07 13:51:23 +0500
commit70ed7a9490a48464aa6cf4dd65f06deb50dbfd56 (patch)
tree0b4bc3227f61bde2cce44a7d7884f9f182840013 /protocols/VKontakte/src/misc.cpp
parentc5b2cbe38b0f23005c8bab0ed9eaab7701f8166a (diff)
VKontakte: fix #4022
Diffstat (limited to 'protocols/VKontakte/src/misc.cpp')
-rw-r--r--protocols/VKontakte/src/misc.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index 07a737377c..885f270381 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -927,6 +927,28 @@ char* CVkProto::GetStickerId(const char *szMsg, int &iStickerId)
return szRetMsg;
}
+uint8_t CVkProto::GetContactType(MCONTACT hContact)
+{
+ if (hContact == INVALID_CONTACT_ID)
+ return 0;
+
+ if (isChatRoom(hContact))
+ return VKContactType::vkContactMUCUser;
+
+ if (IsGroupUser(hContact))
+ return VKContactType::vkContactGroupUser;
+
+ VKUserID_t iUserId = ReadVKUserID(hContact);
+
+ if (!hContact || iUserId == m_iMyUserId)
+ return VKContactType::vkContactSelf;
+
+ if (iUserId == VK_FEED_USER)
+ return 0;
+
+ return VKContactType::vkContactNormal;
+}
+
const char* FindVKUrls(const char *Msg)
{
if (IsEmpty(Msg))