summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-03-09 21:39:47 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-03-09 21:39:47 +0300
commit1b9c80b5b61255e1eede4e98f984694b0aa2f8fc (patch)
tree7ef60ba3fb83819dedf994f98cfd87478186230c
parent01eb4872eaf6872af11e72aa8b3b88f82f677732 (diff)
for #2574: fix for popups in "Always mute" mode
-rw-r--r--src/mir_app/src/chat_manager.cpp4
-rw-r--r--src/mir_app/src/chat_tools.cpp11
2 files changed, 7 insertions, 8 deletions
diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp
index d0d06eb3b0..9c50e4a51d 100644
--- a/src/mir_app/src/chat_manager.cpp
+++ b/src/mir_app/src/chat_manager.cpp
@@ -155,10 +155,6 @@ const char *GCSessionInfoBase::getSoundName(int iEventType) const
if (!(db_get_dw(0, CHAT_MODULE, "SoundFlags", GC_EVENT_HIGHLIGHT) & iEventType))
return nullptr;
- // no sounds in the Mute mode
- if (db_get_b(hContact, "SRMM", "MuteMode", CHATMODE_NORMAL) == CHATMODE_MUTE)
- return nullptr;
-
if (iEventType & GC_EVENT_HIGHLIGHT)
return "ChatHighlight";
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp
index dab4d080ce..8bd5321b66 100644
--- a/src/mir_app/src/chat_tools.cpp
+++ b/src/mir_app/src/chat_tools.cpp
@@ -376,6 +376,7 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight
return FALSE;
BOOL bInactive = si->pDlg == nullptr || !si->pDlg->IsActive();
+ int iMuteMode = db_get_b(si->hContact, "SRMM", "MuteMode", CHATMODE_NORMAL);
if (bHighlight) {
gce->iType |= GC_EVENT_HIGHLIGHT;
@@ -390,10 +391,11 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight
// stupid thing to not create multiple popups for a QUIT event for instance
if (bManyFix == 0) {
// do popups
- if (bInactive || !g_Settings->bPopupInactiveOnly)
- g_chatApi.DoPopup(si, gce);
+ if (iMuteMode != CHATMODE_MUTE)
+ if (bInactive || !g_Settings->bPopupInactiveOnly)
+ g_chatApi.DoPopup(si, gce);
- // do sounds and flashing
+ // do tray icon flashing
if (gce->iType & GC_EVENT_MESSAGE) {
if (bInactive && !(si->wState & STATE_TALK)) {
si->wState |= STATE_TALK;
@@ -403,7 +405,8 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight
g_chatApi.OnFlashWindow(si, bInactive);
}
- if (bInactive || !g_Settings->bSoundsFocus)
+ // no sounds in the Mute mode
+ if ((bInactive || !g_Settings->bSoundsFocus) && iMuteMode != CHATMODE_MUTE)
if (auto szSound = si->getSoundName(gce->iType))
Skin_PlaySound(szSound);
}