summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_thread.cpp
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2015-01-31 08:07:06 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2015-01-31 08:07:06 +0000
commit48696c608103ad2a5adac0e6280d96fa281d726e (patch)
tree2a3b0a9a57301468c5737e6faf966b5b1908c8f2 /protocols/VKontakte/src/vk_thread.cpp
parent7df19254e64619d6b077a7c69b456a39d4a810cb (diff)
VKontakte:
upgrade VK API version to 5.28 (friends.delete change) delete unneeded code UseNonStandardUrlEncode=true by default version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@11964 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_thread.cpp')
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp33
1 files changed, 18 insertions, 15 deletions
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index 0517840911..e59beeab19 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -1127,22 +1127,25 @@ void CVkProto::OnReceiveDeleteFriend(NETLIBHTTPREQUEST* reply, AsyncHttpRequest*
if (tszNick.IsEmpty())
tszNick = TranslateT("(Unknown contact)");
CMString msgformat, msg;
- int iRet = json_as_int(pResponse);
- switch (iRet) {
- case 1:
- msgformat = TranslateT("User %s was deleted from your friend list");
- break;
- case 2:
- msgformat = TranslateT("Friend request from the user %s declined");
- break;
- case 3:
- msgformat = TranslateT("Friend request suggestion for the user %s deleted");
- break;
- }
- msg.AppendFormat(msgformat, tszNick);
- MsgPopup(param->hContact, msg.GetBuffer(), tszNick.GetBuffer());
- setByte(param->hContact, "Auth", 1);
+ if (json_as_int(json_get(pResponse, "success"))) {
+ if (json_as_int(json_get(pResponse, "friend_deleted")))
+ msgformat = TranslateT("User %s was deleted from your friend list");
+ else if (json_as_int(json_get(pResponse, "out_request_deleted")))
+ msgformat = TranslateT("Your request to the user %s was deleted");
+ else if (json_as_int(json_get(pResponse, "in_request_deleted")))
+ msgformat = TranslateT("Friend request from the user %s declined");
+ else if (json_as_int(json_get(pResponse, "suggestion_deleted")))
+ msgformat = TranslateT("Friend request suggestion for the user %s deleted");
+
+ msg.AppendFormat(msgformat, tszNick);
+ MsgPopup(param->hContact, msg.GetBuffer(), tszNick.GetBuffer());
+ setByte(param->hContact, "Auth", 1);
+ }
+ else {
+ msg = TranslateT("User or request was not deleted");
+ MsgPopup(param->hContact, msg.GetBuffer(), tszNick.GetBuffer());
+ }
}
}
delete param;