diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-08-27 09:11:19 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-08-27 09:11:19 +0000 |
commit | 427359cbf083f5c5f709d68fd30bd08392ae57ca (patch) | |
tree | f4b2b936268794ec2681f08ae09c0f84244c019c /protocols/VKontakte/src/vk_feed.cpp | |
parent | 4d8a113f8a325b8d2ff6a008d3a8a5b8e70e2e81 (diff) |
VKontakte:
fix unneeded ‘mark as read’ requests
fix nick in forwarded messages
code cleaning
version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@15040 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_feed.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_feed.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp index abbd9a72bf..b9dee95b9f 100644 --- a/protocols/VKontakte/src/vk_feed.cpp +++ b/protocols/VKontakte/src/vk_feed.cpp @@ -78,7 +78,7 @@ CVkUserInfo* CVkProto::GetVkUserInfo(LONG iUserId, OBJLIST<CVkUserInfo> &vkUsers if (vkUser == NULL) {
CMString tszNick = TranslateT("Unknown");
- CMString tszLink = _T("https://vk.com/");
+ CMString tszLink(_T("https://vk.com/"));
if (iUserId) {
tszLink += bIsGroup ? "club" : "id";
tszLink.AppendFormat(_T("%d"), bIsGroup ? -iUserId : iUserId);
@@ -379,16 +379,14 @@ CVKNewsItem* CVkProto::GetVkParent(const JSONNode &jnParent, VKObjType vkParentT const JSONNode &jnPost = jnParent["post"];
if (jnPost) {
- CMString tszRepl;
- tszRepl.AppendFormat(_T("?reply=%d"), iId);
+ CMString tszRepl(FORMAT, _T("?reply=%d"), iId);
delete vkNotificationItem;
return GetVkParent(jnPost, vkPost, tszText, tszRepl);
}
const JSONNode &jnTopic = jnParent["topic"];
if (jnTopic) {
- CMString tszRepl;
- tszRepl.AppendFormat(_T("?reply=%d"), iId);
+ CMString tszRepl(FORMAT, _T("?reply=%d"), iId);
delete vkNotificationItem;
return GetVkParent(jnTopic, vkTopic, tszText, tszRepl);
}
@@ -450,8 +448,7 @@ CVKNewsItem* CVkProto::GetVkGroupInvates(const JSONNode &jnItem, OBJLIST<CVkUser return NULL;
LONG iGroupId = jnItem["id"].as_int();
- CMString tszId;
- tszId.AppendFormat(_T("%d,"), iGroupId);
+ CMString tszId(FORMAT, _T("%d,"), iGroupId);
CMString tszIds(ptrT(db_get_tsa(NULL, m_szModuleName, "InviteGroupIds")));
if (tszIds.Find(tszId, 0) != -1)
@@ -466,9 +463,9 @@ CVKNewsItem* CVkProto::GetVkGroupInvates(const JSONNode &jnItem, OBJLIST<CVkUser vkNotification->vkFeedbackType = vkFeedbackType;
vkNotification->vkParentType = vkParentType;
- CMString tszGroupName, tszGLink;
+ CMString tszGroupName;
CMString tszGName = jnItem["name"].as_mstring();
- tszGLink.AppendFormat(_T("https://vk.com/%s"), jnItem["screen_name"].as_mstring());
+ CMString tszGLink(FORMAT, _T("https://vk.com/%s"), jnItem["screen_name"].as_mstring());
tszGroupName = SetBBCString(tszGName, m_iBBCForNews, vkbbcUrl, tszGLink);
CMString tszUsers = SetBBCString(iUserId ? vkNotification->vkUser->m_tszUserNick : TranslateT("Unknown"), m_iBBCForNews, vkbbcUrl, iUserId ? vkNotification->vkUser->m_tszLink : _T("https://vk.com/"));
@@ -613,8 +610,7 @@ void CVkProto::RetrieveUnreadNotifications(time_t tLastNotificationsTime) if (time(NULL) - tLastNotificationsReqTime < 3 * 60)
return;
- CMString code;
- code.AppendFormat(_T("return{\"notifications\":API.notifications.get({\"count\": 100, \"start_time\":%d})%s"),
+ CMString code(FORMAT, _T("return{\"notifications\":API.notifications.get({\"count\": 100, \"start_time\":%d})%s"),
(LONG)(tLastNotificationsTime + 1),
m_bNotificationFilterInvites ? _T(",\"groupinvates\":API.groups.getInvites({\"extended\":1})};") : _T("};"));
|