diff options
Diffstat (limited to 'src/mir_app')
-rw-r--r-- | src/mir_app/src/chat_tools.cpp | 16 | ||||
-rw-r--r-- | src/mir_app/src/srmm_log_rtf.cpp | 2 |
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);
|