diff options
author | George Hazan <george.hazan@gmail.com> | 2013-05-06 17:09:28 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-05-06 17:09:28 +0000 |
commit | adc684b43edcca8d5433339993621b26e4fdd2b5 (patch) | |
tree | 2b6720312eba123200346e81fb5626cf1d2c82c5 /protocols/Skype/src/skype_events.cpp | |
parent | f94f16702b87c3c876096723f8e6ad94d63847aa (diff) |
- we display SRMM button only for Skype contacts;
- service & hooks list aren't needed for a while
git-svn-id: http://svn.miranda-ng.org/main/trunk@4594 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_events.cpp')
-rw-r--r-- | protocols/Skype/src/skype_events.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/protocols/Skype/src/skype_events.cpp b/protocols/Skype/src/skype_events.cpp index 53a938a30b..fa75b0d5fe 100644 --- a/protocols/Skype/src/skype_events.cpp +++ b/protocols/Skype/src/skype_events.cpp @@ -17,8 +17,9 @@ int CSkypeProto::OnModulesLoaded(WPARAM, LPARAM) bbd.hIcon = CSkypeProto::GetIconHandle("confSpawn");
bbd.dwButtonID = BBB_ID_CONF_SPAWN;
bbd.dwDefPos = 100 + bbd.dwButtonID;
-
::CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd);
+
+ HookEvent(ME_MSG_WINDOWEVENT, &CSkypeProto::OnSrmmWindowOpen);
}
g_skype->SetOnMessageCallback(
@@ -40,9 +41,7 @@ int CSkypeProto::OnPreShutdown(WPARAM, LPARAM) this->SetStatus(ID_STATUS_OFFLINE);
- this->UninitInstanceHookList();
this->UninitNetLib();
-
return 0;
}
@@ -68,6 +67,20 @@ int CSkypeProto::OnContactDeleted(WPARAM wParam, LPARAM lParam) return 0;
}
+int __cdecl CSkypeProto::OnSrmmWindowOpen(WPARAM, LPARAM lParam)
+{
+ MessageWindowEventData *ev = (MessageWindowEventData*)lParam;
+ if (ev->uType == MSG_WINDOW_EVT_OPENING && ev->hContact)
+ {
+ BBButton bbd = { sizeof(bbd) };
+ bbd.pszModuleName = MODULE;
+ bbd.dwButtonID = BBB_ID_CONF_SPAWN;
+ bbd.bbbFlags = (!strcmp( GetContactProto(ev->hContact), this->m_szModuleName)) ? 0 : BBSF_HIDDEN | BBSF_DISABLED;
+ ::CallService(MS_BB_SETBUTTONSTATE, (WPARAM)ev->hContact, (LPARAM)&bbd);
+ }
+ return 0;
+}
+
INT_PTR __cdecl CSkypeProto::OnAccountManagerInit(WPARAM wParam, LPARAM lParam)
{
return (int)::CreateDialogParam(
|