summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-10-22 20:16:42 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-10-22 20:16:42 +0300
commitacbe9c08e949be95b5549d716232ff7a58785528 (patch)
tree95926b42117f06e01f0655fc14e3d5229d2591e5
parent5f68e67d61e0c0ffa6aacd80eda9e0e5c531cc7a (diff)
fixes #4751 (Mute:Always blocks popups, sounds & blinking)
-rw-r--r--plugins/TabSRMM/src/chat_tools.cpp22
-rw-r--r--src/mir_app/src/chat_tools.cpp16
-rw-r--r--src/mir_app/src/srmm_log_rtf.cpp2
3 files changed, 22 insertions, 18 deletions
diff --git a/plugins/TabSRMM/src/chat_tools.cpp b/plugins/TabSRMM/src/chat_tools.cpp
index 166468ab11..f9686fa2da 100644
--- a/plugins/TabSRMM/src/chat_tools.cpp
+++ b/plugins/TabSRMM/src/chat_tools.cpp
@@ -265,18 +265,20 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight
if (dat->m_pWnd)
dat->m_pWnd->Invalidate();
}
-
- if (iMuteMode != CHATMODE_MUTE) {
- auto sound = si->getSoundName(gce->iType);
- if (dat) {
- bInactive = dat->m_pContainer->m_hwnd != GetForegroundWindow();
- bActiveTab = (dat->m_pContainer->m_hwndActive == dat->GetHwnd());
- if (sound && dat->m_pContainer->MustPlaySound(dat))
- Skin_PlaySound(sound);
- }
- else if (sound)
+
+ // if group chat is always muted, we don't play sounds & flash window
+ if (iMuteMode == CHATMODE_MUTE)
+ return;
+
+ auto sound = si->getSoundName(gce->iType);
+ if (dat) {
+ bInactive = dat->m_pContainer->m_hwnd != GetForegroundWindow();
+ bActiveTab = (dat->m_pContainer->m_hwndActive == dat->GetHwnd());
+ if (sound && dat->m_pContainer->MustPlaySound(dat))
Skin_PlaySound(sound);
}
+ else if (sound)
+ Skin_PlaySound(sound);
// dialog event processing
if (dat) {
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp
index 2c4ba34ddc..6c1f17c8c8 100644
--- a/src/mir_app/src/chat_tools.cpp
+++ b/src/mir_app/src/chat_tools.cpp
@@ -320,7 +320,6 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight
return FALSE;
BOOL bInactive = si->pDlg == nullptr || !si->pDlg->IsActive();
- int iMuteMode = Chat_IsMuted(si->hContact);
if (bHighlight) {
gce->iType |= GC_EVENT_HIGHLIGHT;
@@ -328,6 +327,10 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight
Contact::Hide(si->hContact, false);
}
+ // if group chat is always muted, we don't play sounds & flash window
+ if (Chat_IsMuted(si->hContact) == CHATMODE_MUTE)
+ return true;
+
// do blinking icons in tray
if (bInactive || !g_Settings->bTrayIconInactiveOnly)
g_chatApi.DoTrayIcon(si, gce);
@@ -335,9 +338,8 @@ 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 (iMuteMode != CHATMODE_MUTE)
- if (bInactive || !g_Settings->bPopupInactiveOnly)
- g_chatApi.DoPopup(si, gce);
+ if (bInactive || !g_Settings->bPopupInactiveOnly)
+ g_chatApi.DoPopup(si, gce);
// do tray icon flashing
if (gce->iType & GC_EVENT_MESSAGE) {
@@ -349,8 +351,8 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight
g_chatApi.OnFlashWindow(si, bInactive);
}
- // no sounds in the Mute mode
- if ((bInactive || !g_Settings->bSoundsFocus) && iMuteMode != CHATMODE_MUTE)
+ // sounds
+ if ((bInactive || !g_Settings->bSoundsFocus))
if (auto szSound = si->getSoundName(gce->iType))
Skin_PlaySound(szSound);
}
@@ -358,7 +360,7 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight
if (bHighlight)
if (g_chatApi.OnFlashHighlight)
g_chatApi.OnFlashHighlight(si, bInactive);
- return TRUE;
+ return true;
}
static wchar_t szTrimString[] = L":,.!?;\'>)";
diff --git a/src/mir_app/src/srmm_log_rtf.cpp b/src/mir_app/src/srmm_log_rtf.cpp
index a639264ab7..fe1282d773 100644
--- a/src/mir_app/src/srmm_log_rtf.cpp
+++ b/src/mir_app/src/srmm_log_rtf.cpp
@@ -532,7 +532,7 @@ INT_PTR CRtfLogWindow::WndProc(UINT msg, WPARAM wParam, LPARAM lParam)
pszWord[iLen--] = '\0';
}
- if (iLen) {
+ if (iLen > 0) {
CMStringW wszText(FORMAT, TranslateT("Look up '%s"), pszWord);
if (wszText.GetLength() > 30) {
wszText.Truncate(30);