summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorElzorFox <elzorfox@ya.ru>2019-03-29 10:26:03 +0500
committerElzorFox <elzorfox@ya.ru>2019-03-29 10:26:03 +0500
commit2886b48fd0543151cecaf1739b48c296cbedd4b4 (patch)
tree0c22e0fdad3e27ab174f654cd5346cbf98f05092 /protocols
parentd53931e2e088c5b7a0215b0d1249174c899bd47f (diff)
VKontakte: fix unsupported functions
Diffstat (limited to 'protocols')
-rw-r--r--protocols/VKontakte/src/vk_chats.cpp14
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp2
2 files changed, 12 insertions, 4 deletions
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp
index 0ade10a53c..ce8afc5a67 100644
--- a/protocols/VKontakte/src/vk_chats.cpp
+++ b/protocols/VKontakte/src/vk_chats.cpp
@@ -546,9 +546,12 @@ void CVkProto::LogMenuHook(CVkChatInfo *cc, GCHOOK *gch)
CVkInviteChatForm dlg(this);
if (dlg.DoModal() && dlg.m_hContact != 0) {
LONG uid = getDword(dlg.m_hContact, "ID", VK_INVALID_USER);
- if (uid != VK_INVALID_USER)
+
+ if (uid < 0)
+ MsgPopup(TranslateT("Adding bots to MUC is not supported"), TranslateT("Not supported"));
+ else if (uid != VK_INVALID_USER)
Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/messages.addChatUser.json", true, &CVkProto::OnReceiveSmth)
- << INT_PARAM("user_id", uid < 0 ? 1000000000 - uid : uid)
+ << INT_PARAM("user_id", uid)
<< INT_PARAM("chat_id", cc->m_iChatId));
}
}
@@ -761,9 +764,14 @@ void CVkProto::NickMenuHook(CVkChatInfo *cc, GCHOOK *gch)
if (!IsOnline())
return;
+ if (cu->m_uid < 0) {
+ MsgPopup(TranslateT("Kick bots is not supported"), TranslateT("Not supported"));
+ return;
+ }
+
Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/messages.removeChatUser.json", true, &CVkProto::OnReceiveSmth)
<< INT_PARAM("chat_id", cc->m_iChatId)
- << INT_PARAM("user_id", cu->m_uid < 0 ? 1000000000 - cu->m_uid : cu->m_uid));
+ << INT_PARAM("user_id", cu->m_uid));
cu->m_bUnknown = true;
break;
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp
index 463518635c..e54918090b 100644
--- a/protocols/VKontakte/src/vk_proto.cpp
+++ b/protocols/VKontakte/src/vk_proto.cpp
@@ -531,7 +531,7 @@ int CVkProto::AuthRequest(MCONTACT hContact, const wchar_t *message)
return 1;
if (userID < 0)
- userID = 1000000000 - userID;
+ return 1;
wchar_t msg[501] = { 0 };