From 286ba17e0ca8e025941c8c3d454ea5c1b83b78e3 Mon Sep 17 00:00:00 2001 From: sje Date: Mon, 20 Aug 2007 04:48:12 +0000 Subject: fix creating MYSPACE/srmmicon setting for any contact when window is opened git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@328 4f64403b-2f21-0410-a795-97e2b3489a10 --- MySpace/srmm_icon.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'MySpace/srmm_icon.cpp') diff --git a/MySpace/srmm_icon.cpp b/MySpace/srmm_icon.cpp index 4aaa78f..6283237 100644 --- a/MySpace/srmm_icon.cpp +++ b/MySpace/srmm_icon.cpp @@ -11,17 +11,18 @@ int WindowEvent(WPARAM wParam, LPARAM lParam) { if(wd->uType != MSG_WINDOW_EVT_OPEN) return 0; HANDLE hContact = wd->hContact, hSub = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0); - //if(!hSub) return 0; - + bool hide = false; - if((hSub == 0 && !CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)MODULE)) || (hSub != 0 && !CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hSub, (LPARAM)MODULE))) + if((hSub == 0 && !CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)MODULE)) || (hSub && !CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hSub, (LPARAM)MODULE))) hide = true; - StatusIconData sid = {0}; - sid.cbSize = sizeof(sid); - sid.szModule = MODULE; - sid.flags = (hide ? MBF_HIDDEN : 0); - CallService(MS_MSG_MODIFYICON, (WPARAM)wd->hContact, (LPARAM)&sid); + if(hSub || !hide) { // avoid writing db param for non-myspace and non-meta contacts + StatusIconData sid = {0}; + sid.cbSize = sizeof(sid); + sid.szModule = MODULE; + sid.flags = (hide ? MBF_HIDDEN : 0); + CallService(MS_MSG_MODIFYICON, (WPARAM)wd->hContact, (LPARAM)&sid); + } return 0; } -- cgit v1.2.3