summaryrefslogtreecommitdiff
path: root/src
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 /src
parent5f68e67d61e0c0ffa6aacd80eda9e0e5c531cc7a (diff)
fixes #4751 (Mute:Always blocks popups, sounds & blinking)
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/chat_tools.cpp16
-rw-r--r--src/mir_app/src/srmm_log_rtf.cpp2
2 files changed, 10 insertions, 8 deletions
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);