From 17da1798498188c1f221e738866107e69d6af066 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Fri, 22 Apr 2016 16:53:14 +0000 Subject: MessageState: code cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@16747 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MessageState/src/global.h | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'plugins/MessageState/src/global.h') diff --git a/plugins/MessageState/src/global.h b/plugins/MessageState/src/global.h index 5734fba61d..9260116846 100644 --- a/plugins/MessageState/src/global.h +++ b/plugins/MessageState/src/global.h @@ -1,42 +1,29 @@ #ifndef _GLOBAL_H_ #define _GLOBAL_H_ -static LIST arMonitoredWindows(3, PtrKeySortT); - -static IconItem Icons[] = -{ - { LPGEN("Unread message icon"), "unread_icon", IDI_UNREAD }, - { LPGEN("Read message icon"), "read_icon", IDI_READ }, - { LPGEN("Failed sending icon"), "fail_icon", IDI_FAIL }, - { LPGEN("Sending message icon"), "nosent_icon", IDI_NOSENT }, - { LPGEN("Unread clist extra icon"), "clist_unread_icon", IDI_EXTRA }, -}; - enum SRMM_ICON_TYPE { - ICON_HIDDEN, - ICON_READ, + ICON_HIDDEN = -1, ICON_UNREAD, + ICON_READ, ICON_FAILED, - ICON_NOSENT + ICON_NOSENT, + ICON_EXTRA, }; -#define FLAG_CONTAINS(x,y) ((x & y) == y) - #define DBKEY_MESSAGE_READ_TIME "LastMsgReadTime" #define DBKEY_MESSAGE_READ_TIME_TYPE "LastMsgReadTimeType" __forceinline bool CheckProtoSupport(const char *szProto) -{ return ((szProto != NULL) ? FLAG_CONTAINS(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0), PF4_READNOTIFY) : false); +{ return (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_READNOTIFY) != 0; } void InitServices(); -void DestroyServices(); INT_PTR UpdateService(WPARAM, LPARAM); -int IconsUpdate(WPARAM hContact, LONGLONG readtime); +int IconsUpdate(MCONTACT); void SetSRMMIcon(MCONTACT hContact, SRMM_ICON_TYPE type, time_t time = 0); -LONGLONG GetLastSentMessageTime(MCONTACT hContact); +time_t GetLastSentMessageTime(MCONTACT hContact); int OnModulesLoaded(WPARAM, LPARAM); bool HasUnread(MCONTACT hContact); int ExtraIconsApply(WPARAM hContact, LPARAM); -- cgit v1.2.3