summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/VKontakte/res/resource.rc4
-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
6 files changed, 16 insertions, 12 deletions
diff --git a/protocols/VKontakte/res/resource.rc b/protocols/VKontakte/res/resource.rc
index 3d9193c0ac..861be3ab3c 100644
--- a/protocols/VKontakte/res/resource.rc
+++ b/protocols/VKontakte/res/resource.rc
@@ -135,7 +135,7 @@ BEGIN
GROUPBOX "BBCode support on news and event notifications",IDC_STATIC,4,50,294,48,WS_GROUP
CONTROL "off",IDC_NEWSBBC_OFF,"Button",BS_AUTORADIOBUTTON,12,61,129,10
CONTROL "basic ([b], [i], [u], [s])",IDC_NEWSBBC_BASIC,"Button",BS_AUTORADIOBUTTON,12,72,129,10
- CONTROL "advanced (+[url], [size], [color])",IDC_NEWSBBC_ADV,
+ CONTROL "advanced (+[url], [size], [color], [code])",IDC_NEWSBBC_ADV,
"Button",BS_AUTORADIOBUTTON,154,61,129,10
CONTROL "Use this setting also for attachments on news and notifications",IDC_BBC_ATT_NEWS,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,83,278,10
@@ -143,7 +143,7 @@ BEGIN
GROUPBOX "BBCode support on attachments",IDC_STATIC,4,99,294,38,WS_GROUP
CONTROL "off",IDC_ATTBBC_OFF,"Button",BS_AUTORADIOBUTTON,12,110,129,10
CONTROL "basic ([b], [i], [u], [s])",IDC_ATTBBC_BASIC,"Button",BS_AUTORADIOBUTTON,12,121,129,10
- CONTROL "advanced (+[url], [size], [color])",IDC_ATTBBC_ADV,
+ CONTROL "advanced (+[url], [size], [color], [code])",IDC_ATTBBC_ADV,
"Button",BS_AUTORADIOBUTTON,154,110,129,10
CONTROL "Process stickers as smileys",IDC_STICKERS_AS_SMYLES,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,149,278,10
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 {