From 52fe3f7be13509bd336c5efa28b8310a23211034 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 11 Apr 2013 16:47:12 +0000 Subject: - Srmm_ModifyIcon helper applied instead of CallService(MS_MSG_MODIFYICON) - various fixes related to SRMM icons; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@4426 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NoHistory/src/dllmain.cpp | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) (limited to 'plugins/NoHistory/src') diff --git a/plugins/NoHistory/src/dllmain.cpp b/plugins/NoHistory/src/dllmain.cpp index a579c599a2..1e676bca57 100644 --- a/plugins/NoHistory/src/dllmain.cpp +++ b/plugins/NoHistory/src/dllmain.cpp @@ -183,7 +183,7 @@ INT_PTR ServiceToggle(WPARAM wParam, LPARAM lParam) for (int i = 0; i < 2; ++i) { sid.dwId = i; sid.flags = (i == remove) ? 0 : MBF_HIDDEN; - CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid); + Srmm_ModifyIcon(hContact, &sid); } return 0; } @@ -193,25 +193,23 @@ int WindowEvent(WPARAM wParam, LPARAM lParam) MessageWindowEventData *mwd = (MessageWindowEventData *)lParam; HANDLE hContact = mwd->hContact; - if (mwd->uType == MSG_WINDOW_EVT_CLOSE) { + switch(mwd->uType) { + case MSG_WINDOW_EVT_CLOSE: RemoveReadEvents(hContact); - return 0; - } - - if (mwd->uType != MSG_WINDOW_EVT_OPEN || !ServiceExists(MS_MSG_MODIFYICON)) - return 0; - - char *proto = GetContactProto(hContact); - bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0); - int remove = db_get_b(hContact, MODULE, DBSETTING_REMOVE, 0) != 0; - - StatusIconData sid = {0}; - sid.cbSize = sizeof(sid); - sid.szModule = MODULE; - for (int i=0; i < 2; ++i) { - sid.dwId = i; - sid.flags = (chat_room ? MBF_HIDDEN : (i == remove) ? 0 : MBF_HIDDEN); - CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid); + break; + + case MSG_WINDOW_EVT_OPEN: + char *proto = GetContactProto(hContact); + bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0); + int remove = db_get_b(hContact, MODULE, DBSETTING_REMOVE, 0) != 0; + + StatusIconData sid = { sizeof(sid) }; + sid.szModule = MODULE; + for (int i=0; i < 2; ++i) { + sid.dwId = i; + sid.flags = (chat_room ? MBF_HIDDEN : (i == remove) ? 0 : MBF_HIDDEN); + Srmm_ModifyIcon(hContact, &sid); + } } return 0; -- cgit v1.2.3