diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-05-29 08:45:59 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-05-29 08:45:59 +0000 |
commit | 72e13eb85e4b7aaf0ba82a2de750e1eee454bd6b (patch) | |
tree | 10c5184a19a8b37308e1698839b89c3a37d0225f /protocols/VKontakte/src | |
parent | a5a3fe5b2700d075133da7c17c1e500605dba125 (diff) |
VKontakte:
fix comparator for notifications
version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@13890 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src')
-rw-r--r-- | protocols/VKontakte/src/version.h | 2 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_feed.cpp | 18 |
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"];
|