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_feed.cpp18
2 files changed, 15 insertions, 5 deletions
diff --git a/protocols/VKontakte/src/version.h b/protocols/VKontakte/src/version.h
index bf21fdd8f2..d75ec44455 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 3
+#define __BUILD_NUM 4
#include <stdver.h>
diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp
index 1ee1c184a1..518fa08935 100644
--- a/protocols/VKontakte/src/vk_feed.cpp
+++ b/protocols/VKontakte/src/vk_feed.cpp
@@ -536,8 +536,20 @@ void CVkProto::RetrieveUnreadNews(time_t tLastNewsTime)
}
static int sttCompareVKNewsItems(const CVKNewsItem *p1, const CVKNewsItem *p2)
+{
+ int compareId = p1->tszId.Compare(p2->tszId);
+ LONG compareDate = (LONG)p1->tDate - (LONG)p2->tDate;
+
+ return compareId ? compareDate : 0;
+}
+
+static int sttCompareVKNotificationItems(const CVKNewsItem *p1, const CVKNewsItem *p2)
{
- return p1->tszId.Compare(p2->tszId) ? (LONG)p1->tDate - (LONG)p2->tDate : 0;
+ int compareType = p1->tszType.Compare(p2->tszType);
+ int compareId = p1->tszId.Compare(p2->tszId);
+ LONG compareDate = (LONG)p1->tDate - (LONG)p2->tDate;
+
+ return compareType ? compareDate : (compareId ? compareDate : 0);
}
void CVkProto::OnReceiveUnreadNews(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
@@ -644,13 +656,11 @@ void CVkProto::OnReceiveUnreadNotifications(NETLIBHTTPREQUEST *reply, AsyncHttpR
const JSONNode &jnGroupInvates = jnResponse["groupinvates"];
OBJLIST<CVkUserInfo> vkUsers(5, NumericKeySortT);
- OBJLIST<CVKNewsItem> vkNotification(5, sttCompareVKNewsItems);
+ OBJLIST<CVKNewsItem> vkNotification(5, sttCompareVKNotificationItems);
CreateVkUserInfoList(vkUsers, jnNotifications);
CreateVkUserInfoList(vkUsers, jnGroupInvates);
-
-
if (!jnNotifications.isnull()) {
const JSONNode &jnItems = jnNotifications["items"];