From 88167d8a0f7f0e3b8fbad7c8204732995bd265be Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Tue, 1 Mar 2016 09:07:34 +0000 Subject: =?UTF-8?q?VKontakte:=20update=20VK=20API=20version=20to=205.45=20?= =?UTF-8?q?change=20SvcGetServerHistoryLastXXDay=E2=80=99s=20to=20template?= =?UTF-8?q?=20function=20(path=20by=20MikalaiR)=20version=20bump?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.miranda-ng.org/main/trunk@16382 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/version.h | 2 +- protocols/VKontakte/src/vk.h | 2 +- protocols/VKontakte/src/vk_history.cpp | 50 ---------------------------------- protocols/VKontakte/src/vk_proto.cpp | 10 +++---- protocols/VKontakte/src/vk_proto.h | 15 ++++++---- 5 files changed, 17 insertions(+), 62 deletions(-) (limited to 'protocols') 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 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 . #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 //==== 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 + 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(); -- cgit v1.2.3