summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/VKontakte/src')
-rw-r--r--protocols/VKontakte/src/version.h2
-rw-r--r--protocols/VKontakte/src/vk.h2
-rw-r--r--protocols/VKontakte/src/vk_chats.cpp6
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp2
-rw-r--r--protocols/VKontakte/src/vkjs.js14
5 files changed, 16 insertions, 10 deletions
diff --git a/protocols/VKontakte/src/version.h b/protocols/VKontakte/src/version.h
index e7a6adffcc..0389c1468a 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 16
-#define __BUILD_NUM 9
+#define __BUILD_NUM 10
#include <stdver.h>
diff --git a/protocols/VKontakte/src/vk.h b/protocols/VKontakte/src/vk.h
index c5cd548119..152f77c8eb 100644
--- a/protocols/VKontakte/src/vk.h
+++ b/protocols/VKontakte/src/vk.h
@@ -88,7 +88,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define VK_USER_DEACTIVATE_ACTION 9321
-#define VK_API_VER "5.199"
+#define VK_API_VER "5.236"
#define VER_API CHAR_PARAM("v", VK_API_VER)
#define VK_FEED_USER 2147483647L
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp
index d58c53c801..90c38fb366 100644
--- a/protocols/VKontakte/src/vk_chats.cpp
+++ b/protocols/VKontakte/src/vk_chats.cpp
@@ -218,13 +218,15 @@ void CVkProto::OnReceiveChatInfo(MHttpResponse *reply, AsyncHttpRequest *pReq)
SetChatTitle(cc, jnInfo["title"].as_mstring());
- CMStringW wszValue = jnInfo["photo_100"].as_mstring();
+ CMStringW wszValue = jnInfo["photo"] ? jnInfo["photo"]["photo_100"].as_mstring() : "";
if (!wszValue.IsEmpty()) {
SetAvatarUrl(cc->m_si->hContact, wszValue);
ReloadAvatarInfo(cc->m_si->hContact);
}
- if (jnInfo["left"].as_bool() || jnInfo["kicked"].as_bool()) {
+ CMStringW wszState = jnInfo["state"].as_mstring();
+
+ if (jnInfo["left"].as_bool() || jnInfo["kicked"].as_bool() || wszState == L"left" || wszState == L"kicked") {
setByte(cc->m_si->hContact, "kicked", jnInfo["kicked"].as_bool());
LeaveChat(cc->m_iChatId);
return;
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index 08a09e3ca9..47484a2d60 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -676,7 +676,7 @@ void CVkProto::RetrieveGroupInfo(VKUserID_t iGroupId)
Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/groups.getById.json", true, &CVkProto::OnReceiveGroupInfo)
<< CHAR_PARAM("fields", "description")
- << INT_PARAM("group_id", -1 * iGroupId));
+ << INT_PARAM("group_ids", -1 * iGroupId));
}
void CVkProto::RetrieveGroupInfo(CMStringA& groupIDs)
diff --git a/protocols/VKontakte/src/vkjs.js b/protocols/VKontakte/src/vkjs.js
index 59a57a0677..7feb127504 100644
--- a/protocols/VKontakte/src/vkjs.js
+++ b/protocols/VKontakte/src/vkjs.js
@@ -374,9 +374,10 @@ return { "info": Info, "users": ChatUsers, "msgs": ChatMsg, "fwd_users": FUsers
// ver 4
-var Info = API.messages.getChat({ "chat_id": Args.chatid });
var PeerId = 2000000000 + parseInt(Args.chatid);
-var ChatUsers = API.messages.getConversationMembers({ "peer_id": PeerId, "fields": "id,first_name,last_name" });
+var Conv=API.messages.getConversationsById({"peer_ids": PeerId});
+var Info=Conv.items[0].chat_settings;
+var ChatUsers = API.messages.getConversationMembers({ "peer_id": PeerId, extended: 1, "fields": "id,first_name,last_name" });
var ChatMsg = API.messages.getHistory({ "peer_id": PeerId, "count": 20, "rev": 0 });
var UR = parseInt(ChatMsg.unread);
if (UR > 20) {
@@ -410,13 +411,16 @@ var MsgUsers = API.users.get({ "user_ids": ChatMsg.items@.from_id, "fields":"id,
return { "info": Info, "users": ChatUsers, "msgs": ChatMsg, "fwd_users": FUsers + GUsers.groups, "msgs_users": MsgUsers};
-
// ver 5
-var Info=API.messages.getChat({"chat_id": Args.chatid});
var PeerId = 2000000000 + parseInt(Args.chatid);
-var ChatUsers = API.messages.getConversationMembers({ "peer_id": PeerId, "fields": "id,first_name,last_name" });
+var Conv=API.messages.getConversationsById({"peer_ids": PeerId});
+var Info=Conv.items[0].chat_settings;
+var ChatUsers = API.messages.getConversationMembers({ "peer_id": PeerId, extended: 1, "fields": "id,first_name,last_name" });
return {"info":Info,"users":ChatUsers};
+
+
+
// Stored procedure name: RetrieveChatInfo = End
// Stored procedure name: DestroyKickChat = Begin