From 73c1261a4fd2a7adfa496e054846c61167ce7fff Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 17 Sep 2020 20:38:05 +0300 Subject: muted chat not to generate any sounds either --- src/mir_app/src/chat.h | 4 ---- src/mir_app/src/chat_manager.cpp | 2 +- src/mir_app/src/chat_tools.cpp | 5 +++-- 3 files changed, 4 insertions(+), 7 deletions(-) (limited to 'src/mir_app') diff --git a/src/mir_app/src/chat.h b/src/mir_app/src/chat.h index edefe3af39..790bb5ec18 100644 --- a/src/mir_app/src/chat.h +++ b/src/mir_app/src/chat.h @@ -25,10 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -#define CHATMODE_NORMAL 0 -#define CHATMODE_MUTE 1 -#define CHATMODE_UNMUTE 2 - void Srmm_CreateToolbarIcons(HWND hwndDlg, int flags); void Srmm_ProcessToolbarHotkey(MCONTACT hContact, INT_PTR iButtonFrom, HWND hwndDlg); diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp index 74b56fed8c..7456567452 100644 --- a/src/mir_app/src/chat_manager.cpp +++ b/src/mir_app/src/chat_manager.cpp @@ -78,7 +78,7 @@ static SESSION_INFO* GetActiveSession(void) // Log manager functions // Necessary to keep track of events in a window log -static LOGINFO *LM_AddEvent(LOGINFO **ppLogListStart, LOGINFO **ppLogListEnd) +static LOGINFO* LM_AddEvent(LOGINFO **ppLogListStart, LOGINFO **ppLogListEnd) { if (!ppLogListStart || !ppLogListEnd) return nullptr; diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp index 424ead734e..682c176aeb 100644 --- a/src/mir_app/src/chat_tools.cpp +++ b/src/mir_app/src/chat_tools.cpp @@ -367,10 +367,11 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight BOOL bInactive = si->pDlg == nullptr || !si->pDlg->IsActive(); int iEvent = gce->iType; + bool bMute = db_get_b(si->hContact, "SRMM", "MuteMode", CHATMODE_NORMAL) == CHATMODE_MUTE; if (bHighlight) { gce->iType |= GC_EVENT_HIGHLIGHT; - if (bInactive || !g_Settings->bSoundsFocus) + if (!bMute && (bInactive || !g_Settings->bSoundsFocus)) Skin_PlaySound("ChatHighlight"); if (Contact_IsHidden(si->hContact)) Contact_Hide(si->hContact, false); @@ -419,7 +420,7 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight } if (db_get_dw(0, CHAT_MODULE, "SoundFlags", GC_EVENT_HIGHLIGHT) & iEvent) - if (szSound && (bInactive || !g_Settings->bSoundsFocus)) + if (!bMute && szSound && (bInactive || !g_Settings->bSoundsFocus)) Skin_PlaySound(szSound); } -- cgit v1.2.3