diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/StartupSilence/src/StartupSilence.h | 8 | ||||
-rw-r--r-- | plugins/StartupSilence/src/main.cpp | 17 |
2 files changed, 23 insertions, 2 deletions
diff --git a/plugins/StartupSilence/src/StartupSilence.h b/plugins/StartupSilence/src/StartupSilence.h index 41f0ae88d2..99cf3ed2be 100644 --- a/plugins/StartupSilence/src/StartupSilence.h +++ b/plugins/StartupSilence/src/StartupSilence.h @@ -31,11 +31,19 @@ void UpdateMenu(); void UpdateTTB();
INT_PTR SturtupSilenceEnabled(WPARAM wParam, LPARAM lParam);
+INT_PTR SilenceConnection(WPARAM wParam, LPARAM lParam);
#define MODULE_NAME "StartupSilence"
#define SS_SERVICE_NAME "StartupSilence/ToggleEnabled"
+#define SS_SILENCE_CONNECTION "StartupSilence/SilenceConnection"
+//StartupSilence/SilenceConnection
+//external service for mute sound and popups according to plugin settings
+//wParam = 2 - SilenceConnection is on
+//wParam = 0 - SilenceConnection is off
+//lParam = 0 - not in use
+
#define POPUPONOFF "Popup/ToggleEnabled"
#define POPUPONOFFPP "Popup/EnableDisableMenuCommand"
diff --git a/plugins/StartupSilence/src/main.cpp b/plugins/StartupSilence/src/main.cpp index 208f2a2f9a..a3be4ce0ad 100644 --- a/plugins/StartupSilence/src/main.cpp +++ b/plugins/StartupSilence/src/main.cpp @@ -94,6 +94,7 @@ INT_PTR StartupSilence() HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
mir_forkthread((pThreadFunc)AdvSt, NULL);
CreateServiceFunction(SS_SERVICE_NAME, SturtupSilenceEnabled);
+ CreateServiceFunction(SS_SILENCE_CONNECTION, SilenceConnection);
IsMenu();
HookEvent(ME_OPT_INITIALISE, InitializeOptions);
return 0;
@@ -134,13 +135,16 @@ int DisablePopup(WPARAM wParam, LPARAM lParam) if ((timer == 2 && NonStatusAllow == 1) //filtering while timer
|| (DefPopup == 1 && DefEnabled == 1)) //also filtered only: We do not run next lines every time
//if "Filtered only..." is unchecked --->
- {
+ {
HANDLE hContact = (HANDLE)wParam;
- if (hContact != NULL) {
+ if (hContact != NULL)
+ {
char* cp = GetContactProto(hContact);
if ( !strcmp(cp, "Weather") || !strcmp(cp, "mRadio") )
return 0;
}
+ else return 0; //allow popups for unread mail notification from MRA, keepstatus ... other services?
+
return 1; //filtering while timer
}
return 0; //---> just allow all popups with this return
@@ -278,6 +282,15 @@ static INT_PTR SturtupSilenceEnabled(WPARAM wParam, LPARAM lParam) return 0;
}
+static INT_PTR SilenceConnection(WPARAM wParam, LPARAM lParam)
+{
+ timer = (BYTE)wParam;
+// if (timer == 2) //commented for now
+// db_set_b(NULL, "Skin", "UseSound", 0);
+// else db_set_b(NULL, "Skin", "UseSound", 1);
+ return 0;
+}
+
static INT_PTR InitMenu()
{
CLISTMENUITEM mi = {sizeof(mi)};
|