summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2015-12-29 03:01:27 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2015-12-29 03:01:27 +0000
commitcc18d9391b12c7746083de3e93f6348d866efec7 (patch)
tree59f25959c2b7a21a7aa2e30b9b25b72c20e837e8 /protocols/VKontakte/src
parent533a0aa0576ed31f1840c099267a34330952c4e8 (diff)
VKontakte:
update VK_API version to 5.42 add [code] bbc for forwarding messages load unread message for muc on connect version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@15961 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src')
-rw-r--r--protocols/VKontakte/src/misc.cpp5
-rw-r--r--protocols/VKontakte/src/version.h2
-rw-r--r--protocols/VKontakte/src/vk.h2
-rw-r--r--protocols/VKontakte/src/vk_chats.cpp13
-rw-r--r--protocols/VKontakte/src/vk_struct.h2
5 files changed, 14 insertions, 10 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index c02477735e..aab000491f 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -847,6 +847,9 @@ CMString CVkProto::SetBBCString(LPCTSTR ptszString, BBCSupport iBBC, VKBBCType b
{ vkbbcU, bbcNo, _T("%s") },
{ vkbbcU, bbcBasic, _T("[u]%s[/u]") },
{ vkbbcU, bbcAdvanced, _T("[u]%s[/u]") },
+ { vkbbcCode, bbcNo, _T("%s") },
+ { vkbbcCode, bbcBasic, _T("%s") },
+ { vkbbcCode, bbcAdvanced, _T("[code]%s[/code]") },
{ vkbbcImg, bbcNo, _T("%s") },
{ vkbbcImg, bbcBasic, _T("[img]%s[/img]") },
{ vkbbcImg, bbcAdvanced, _T("[img]%s[/img]") },
@@ -1139,7 +1142,7 @@ CMString CVkProto::GetFwdMessages(const JSONNode &jnMessages, const JSONNode &jn
tcSplit,
SetBBCString(TranslateT("at"), iBBC, vkbbcB),
ttime,
- tszBody);
+ SetBBCString(tszBody, iBBC, vkbbcCode));
if (!res.IsEmpty())
res.AppendChar(_T('\n'));
diff --git a/protocols/VKontakte/src/version.h b/protocols/VKontakte/src/version.h
index 39d0d3708a..4ed7ce80b4 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 1
-#define __BUILD_NUM 19
+#define __BUILD_NUM 20
#include <stdver.h>
diff --git a/protocols/VKontakte/src/vk.h b/protocols/VKontakte/src/vk.h
index 3ccc5f89b1..1d3ee166e1 100644
--- a/protocols/VKontakte/src/vk.h
+++ b/protocols/VKontakte/src/vk.h
@@ -80,7 +80,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define VKERR_INVALID_URL 10106 // Upload server returned empty URL
#define VKERR_INVALID_USER 10107 // Invalid or unknown recipient user ID
-#define VK_API_VER "5.40"
+#define VK_API_VER "5.42"
#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 0287809189..b6adda8b87 100644
--- a/protocols/VKontakte/src/vk_chats.cpp
+++ b/protocols/VKontakte/src/vk_chats.cpp
@@ -104,16 +104,17 @@ void CVkProto::RetrieveChatInfo(CVkChatInfo *cc)
{
CMStringA tszQuery(FORMAT, "var ChatId=%d;", cc->m_chatid);
- tszQuery += "var Info=API.messages.getChat({\"chat_id\":ChatId});";
- tszQuery += "var ChatUsers=API.messages.getChatUsers({\"chat_id\":ChatId,\"fields\":\"id,first_name,last_name\"});";
+ tszQuery += "var Info=API.messages.getChat({\"chat_id\":ChatId});"
+ "var ChatUsers=API.messages.getChatUsers({\"chat_id\":ChatId,\"fields\":\"id,first_name,last_name\"});";
if (!cc->m_bHistoryRead) {
- tszQuery += "var ChatMsg=API.messages.getHistory({\"chat_id\":ChatId,\"count\":20,\"rev\":0});";
- tszQuery += "var FMsgs = ChatMsg.items@.fwd_messages;var Idx = 0;var Uids =[];while (Idx < FMsgs.length){"
+ tszQuery += "var ChatMsg=API.messages.getHistory({\"chat_id\":ChatId,\"count\":20,\"rev\":0});var UR=parseInt(ChatMsg.unread);"
+ "if(UR>20){if(UR>200)UR=200;ChatMsg=API.messages.getHistory({\"chat_id\":ChatId,\"count\":UR,\"rev\":0});};"
+ "var FMsgs = ChatMsg.items@.fwd_messages;var Idx = 0;var Uids =[];while (Idx < FMsgs.length){"
"var Jdx = 0;var CFMsgs = parseInt(FMsgs[Idx].length);while (Jdx < CFMsgs){"
"Uids.unshift(FMsgs[Idx][Jdx].user_id);Jdx = Jdx + 1;};Idx = Idx + 1;};"
- "var FUsers = API.users.get({\"user_ids\": Uids, \"name_case\":\"gen\"});";
- tszQuery += "var MsgUsers=API.users.get({\"user_ids\":ChatMsg.items@.user_id,\"fields\":\"id,first_name,last_name\"});";
+ "var FUsers = API.users.get({\"user_ids\": Uids, \"name_case\":\"gen\"});"
+ "var MsgUsers=API.users.get({\"user_ids\":ChatMsg.items@.user_id,\"fields\":\"id,first_name,last_name\"});";
}
tszQuery += "return {\"info\":Info,\"users\":ChatUsers";
diff --git a/protocols/VKontakte/src/vk_struct.h b/protocols/VKontakte/src/vk_struct.h
index 1a55218a55..6207d52f9a 100644
--- a/protocols/VKontakte/src/vk_struct.h
+++ b/protocols/VKontakte/src/vk_struct.h
@@ -220,7 +220,7 @@ struct CVKNewsItem : public MZeroedObject {
bool bIsRepost;
};
-enum VKBBCType { vkbbcB, vkbbcI, vkbbcS, vkbbcU, vkbbcImg, vkbbcUrl, vkbbcSize, vkbbcColor };
+enum VKBBCType { vkbbcB, vkbbcI, vkbbcS, vkbbcU, vkbbcCode, vkbbcImg, vkbbcUrl, vkbbcSize, vkbbcColor };
enum BBCSupport { bbcNo, bbcBasic, bbcAdvanced };
struct CVKBBCItem {