diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2016-03-01 09:07:34 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2016-03-01 09:07:34 +0000 |
commit | 88167d8a0f7f0e3b8fbad7c8204732995bd265be (patch) | |
tree | 85f42a3b36918ebe5519e13feaf59f94e093a542 /protocols/VKontakte | |
parent | d575132cdc94cf476fee70859aa673a31aba3ea4 (diff) |
VKontakte:
update VK API version to 5.45
change SvcGetServerHistoryLastXXDay’s to template function (path by MikalaiR)
version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@16382 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte')
-rw-r--r-- | protocols/VKontakte/src/version.h | 2 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk.h | 2 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_history.cpp | 50 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_proto.cpp | 10 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_proto.h | 15 |
5 files changed, 17 insertions, 62 deletions
diff --git a/protocols/VKontakte/src/version.h b/protocols/VKontakte/src/version.h index 613d6cab93..66b24a328c 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 22
+#define __BUILD_NUM 23
#include <stdver.h>
diff --git a/protocols/VKontakte/src/vk.h b/protocols/VKontakte/src/vk.h index e6ca133310..1431b8b53f 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.44"
+#define VK_API_VER "5.45"
#define VER_API CHAR_PARAM("v", VK_API_VER)
#define VK_FEED_USER 2147483647L
diff --git a/protocols/VKontakte/src/vk_history.cpp b/protocols/VKontakte/src/vk_history.cpp index 31ab6fb0f6..183f661164 100644 --- a/protocols/VKontakte/src/vk_history.cpp +++ b/protocols/VKontakte/src/vk_history.cpp @@ -44,56 +44,6 @@ INT_PTR __cdecl CVkProto::SvcGetAllServerHistory(WPARAM hContact, LPARAM) return 1;
}
-INT_PTR __cdecl CVkProto::SvcGetServerHistoryLast1Day(WPARAM hContact, LPARAM)
-{
- debugLogA("CVkProto::SvcGetServerHistoryLast1Day");
- if (!IsOnline())
- return 0;
-
- GetServerHistoryLastNDay(hContact, 1);
- return 1;
-}
-
-INT_PTR __cdecl CVkProto::SvcGetServerHistoryLast3Day(WPARAM hContact, LPARAM)
-{
- debugLogA("CVkProto::SvcGetServerHistoryLast3Day");
- if (!IsOnline())
- return 0;
-
- GetServerHistoryLastNDay(hContact, 3);
- return 1;
-}
-
-INT_PTR __cdecl CVkProto::SvcGetServerHistoryLast7Day(WPARAM hContact, LPARAM)
-{
- debugLogA("CVkProto::SvcGetServerHistoryLast7Day");
- if (!IsOnline())
- return 0;
-
- GetServerHistoryLastNDay(hContact, 7);
- return 1;
-}
-
-INT_PTR __cdecl CVkProto::SvcGetServerHistoryLast30Day(WPARAM hContact, LPARAM)
-{
- debugLogA("CVkProto::SvcGetServerHistoryLast30Day");
- if (!IsOnline())
- return 0;
-
- GetServerHistoryLastNDay(hContact, 30);
- return 1;
-}
-
-INT_PTR __cdecl CVkProto::SvcGetServerHistoryLast90Day(WPARAM hContact, LPARAM)
-{
- debugLogA("CVkProto::SvcGetServerHistoryLast90Day");
- if (!IsOnline())
- return 0;
-
- GetServerHistoryLastNDay(hContact, 90);
- return 1;
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
void CVkProto::GetServerHistoryLastNDay(MCONTACT hContact, int NDay)
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index e01fb54ba4..f3c1fa77a5 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -196,11 +196,11 @@ void CVkProto::InitMenus() HookProtoEvent(ME_CLIST_PREBUILDCONTACTMENU, &CVkProto::OnPreBuildContactMenu);
//Contact Menu Services
- CreateProtoService(PS_GETSERVERHISTORYLAST1DAY, &CVkProto::SvcGetServerHistoryLast1Day);
- CreateProtoService(PS_GETSERVERHISTORYLAST3DAY, &CVkProto::SvcGetServerHistoryLast3Day);
- CreateProtoService(PS_GETSERVERHISTORYLAST7DAY, &CVkProto::SvcGetServerHistoryLast7Day);
- CreateProtoService(PS_GETSERVERHISTORYLAST30DAY, &CVkProto::SvcGetServerHistoryLast30Day);
- CreateProtoService(PS_GETSERVERHISTORYLAST90DAY, &CVkProto::SvcGetServerHistoryLast90Day);
+ CreateProtoService(PS_GETSERVERHISTORYLAST1DAY, &CVkProto::SvcGetServerHistoryLastNDay<1>);
+ CreateProtoService(PS_GETSERVERHISTORYLAST3DAY, &CVkProto::SvcGetServerHistoryLastNDay<3>);
+ CreateProtoService(PS_GETSERVERHISTORYLAST7DAY, &CVkProto::SvcGetServerHistoryLastNDay<7>);
+ CreateProtoService(PS_GETSERVERHISTORYLAST30DAY, &CVkProto::SvcGetServerHistoryLastNDay<30>);
+ CreateProtoService(PS_GETSERVERHISTORYLAST90DAY, &CVkProto::SvcGetServerHistoryLastNDay<90>);
CreateProtoService(PS_GETALLSERVERHISTORY, &CVkProto::SvcGetAllServerHistory);
CreateProtoService(PS_VISITPROFILE, &CVkProto::SvcVisitProfile);
CreateProtoService(PS_CREATECHAT, &CVkProto::SvcCreateChat);
diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h index 4ac93491ed..dde6d762e9 100644 --- a/protocols/VKontakte/src/vk_proto.h +++ b/protocols/VKontakte/src/vk_proto.h @@ -109,11 +109,16 @@ struct CVkProto : public PROTO<CVkProto> //==== History Menus ==================================================================
- INT_PTR __cdecl SvcGetServerHistoryLast1Day(WPARAM hContact, LPARAM);
- INT_PTR __cdecl SvcGetServerHistoryLast3Day(WPARAM hContact, LPARAM);
- INT_PTR __cdecl SvcGetServerHistoryLast7Day(WPARAM hContact, LPARAM);
- INT_PTR __cdecl SvcGetServerHistoryLast30Day(WPARAM hContact, LPARAM);
- INT_PTR __cdecl SvcGetServerHistoryLast90Day(WPARAM hContact, LPARAM);
+ template <unsigned short Days>
+ INT_PTR __cdecl SvcGetServerHistoryLastNDay(WPARAM hContact, LPARAM)
+ {
+ debugLogA("CVkProto::SvcGetServerHistoryLast%dDay", Days);
+ if (!IsOnline())
+ return 0;
+ GetServerHistoryLastNDay(hContact, Days);
+ return 1;
+ }
+
INT_PTR __cdecl SvcGetAllServerHistory(WPARAM hContact, LPARAM);
void InitMenus();
void UnInitMenus();
|