From e866f23fb250ef42e795c660f9769a3c2a62db62 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Wed, 19 Aug 2015 08:56:43 +0000 Subject: Toaster: fixed avatars; warning fixes; version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@14993 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Toaster/src/services.cpp | 22 ++++++++++++---------- plugins/Toaster/src/version.h | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) (limited to 'plugins') diff --git a/plugins/Toaster/src/services.cpp b/plugins/Toaster/src/services.cpp index fab8a4cd64..62b7596a72 100644 --- a/plugins/Toaster/src/services.cpp +++ b/plugins/Toaster/src/services.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" __forceinline bool isChatRoom(MCONTACT hContact) -{ return db_get_b(hContact, ptrA(GetContactProto(hContact)), "ChatRoom", 0); +{ return (bool)db_get_b(hContact, ptrA(GetContactProto(hContact)), "ChatRoom", 0); } static void __cdecl OnToastNotificationClicked(void* arg) @@ -17,9 +17,9 @@ static void __cdecl OnToastNotificationClicked(void* arg) { ptrA szProto(GetContactProto(hContact)); ptrT szChatRoom(db_get_tsa(hContact, szProto, "ChatRoomID")); - GCDEST gcd = { szProto, szChatRoom, GC_EVENT_CONTROL }; - GCEVENT gce = { sizeof(gce), &gcd }; - + GCDEST gcd = { szProto, szChatRoom, GC_EVENT_CONTROL }; + GCEVENT gce = { sizeof(gce), &gcd }; + gcd.iType = GC_EVENT_CONTROL; gce.time = time(NULL); @@ -39,11 +39,15 @@ static void ShowToastNotification(TCHAR* text, TCHAR* title, MCONTACT hContact) { eventHandler = new ToastEventHandler(OnToastNotificationClicked, (void*)hContact); - TCHAR avatarPath[MAX_PATH] = { 0 }; const char* szProto = GetContactProto(hContact); - if (ProtoServiceExists(szProto, PS_GETMYAVATAR)) - if (!CallProtoService(szProto, PS_GETMYAVATAR, (WPARAM)avatarPath, (LPARAM)MAX_PATH)) - imagePath = mir_tstrdup(avatarPath); + PROTO_AVATAR_INFORMATION pai; + pai.hContact = hContact; + if (ProtoServiceExists(szProto, PS_GETAVATARINFO)) + { + + CallProtoService(szProto, PS_GETAVATARINFO, (WPARAM)0, (LPARAM)&pai); + imagePath = mir_tstrdup(pai.filename); + } } else eventHandler = new ToastEventHandler(nullptr); @@ -117,8 +121,6 @@ static INT_PTR PopupQuery(WPARAM wParam, LPARAM) default: return 1; } - - return 0; } void InitServices() diff --git a/plugins/Toaster/src/version.h b/plugins/Toaster/src/version.h index 5b2f4a42f1..aea2503105 100644 --- a/plugins/Toaster/src/version.h +++ b/plugins/Toaster/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 11 #define __RELEASE_NUM 0 -#define __BUILD_NUM 1 +#define __BUILD_NUM 2 #include -- cgit v1.2.3