diff options
author | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-08-20 04:36:27 +0000 |
---|---|---|
committer | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-08-20 04:36:27 +0000 |
commit | 51eb51ae0c417a76dbbd9533639e533d63597842 (patch) | |
tree | 0cbd60ba4f52403493bc77482d21722388158240 /MySpace/srmm_icon.cpp | |
parent | 0841bef9c8e05efa48ebe9c703fbd8ce8fb1a278 (diff) |
fix for zap menu not showing for new contacts (thx plastic)
lookup user info when adding permanently to list or via contact search
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@327 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'MySpace/srmm_icon.cpp')
-rw-r--r-- | MySpace/srmm_icon.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/MySpace/srmm_icon.cpp b/MySpace/srmm_icon.cpp index 053b0c7..4aaa78f 100644 --- a/MySpace/srmm_icon.cpp +++ b/MySpace/srmm_icon.cpp @@ -11,10 +11,10 @@ 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;
+ //if(!hSub) return 0;
bool hide = false;
- if(!CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hSub, (LPARAM)MODULE))
+ if((hSub == 0 && !CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)MODULE)) || (hSub != 0 && !CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hSub, (LPARAM)MODULE)))
hide = true;
StatusIconData sid = {0};
@@ -51,8 +51,13 @@ int IconPressed(WPARAM wParam, LPARAM lParam) { return 0;
}
+int ContactAdded(WPARAM wParam, LPARAM lParam) {
+
+ return 0;
+}
+
HICON hZapIcon = 0;
-HANDLE hEventIconPressed = 0, hEventWindow = 0;
+HANDLE hEventIconPressed = 0, hEventWindow = 0, hEventContactAdded;
void InitSRMMIcon() {
// add icon to srmm status icons
if(ServiceExists(MS_MSG_ADDICON)) {
@@ -66,11 +71,12 @@ void InitSRMMIcon() { sid.szTooltip = Translate("Send ZAP");
CallService(MS_MSG_ADDICON, 0, (LPARAM)&sid);
- // hook the window events so that we can can change the status of the icon for metacontacts
+ // hook the window events so that we can can change the status of the icon for myspace contacts and metacontacts if necessary
if(ServiceExists(MS_MC_GETMOSTONLINECONTACT)) // metas installed
hEventWindow = HookEvent(ME_MSG_WINDOWEVENT, WindowEvent);
hEventIconPressed = HookEvent(ME_MSG_ICONPRESSED, IconPressed);
+ /*
// show for all MySpace contacts
HANDLE hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
while ( hContact != NULL ) {
@@ -81,10 +87,14 @@ void InitSRMMIcon() { }
hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM ) hContact, 0 );
}
+ */
}
+
+ hEventContactAdded = HookEvent(ME_DB_CONTACT_ADDED, ContactAdded);
}
void DeinitSRMMIcon() {
+ if(hEventContactAdded) UnhookEvent(hEventContactAdded);
if(hZapIcon) DestroyIcon(hZapIcon);
if(hEventIconPressed) UnhookEvent(hEventIconPressed);
if(hEventWindow) UnhookEvent(hEventWindow);
|