diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp index 56418a4393d..d0d06eb3b08 100644 --- a/src/mir_app/src/chat_manager.cpp +++ b/src/mir_app/src/chat_manager.cpp @@ -159,6 +159,9 @@ const char *GCSessionInfoBase::getSoundName(int iEventType) const if (db_get_b(hContact, "SRMM", "MuteMode", CHATMODE_NORMAL) == CHATMODE_MUTE) return nullptr; + if (iEventType & GC_EVENT_HIGHLIGHT) + return "ChatHighlight"; + switch (iEventType) { case GC_EVENT_JOIN: return "ChatJoin"; case GC_EVENT_PART: return "ChatPart"; diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp index ae9fec2d5f3..dab4d080ce9 100644 --- a/src/mir_app/src/chat_tools.cpp +++ b/src/mir_app/src/chat_tools.cpp @@ -377,22 +377,10 @@ 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 (!bMute && (bInactive || !g_Settings->bSoundsFocus)) - Skin_PlaySound("ChatHighlight"); if (Contact_IsHidden(si->hContact)) Contact_Hide(si->hContact, false); - if (bInactive) - g_chatApi.DoTrayIcon(si, gce); - if (bInactive || !g_Settings->bPopupInactiveOnly) - g_chatApi.DoPopup(si, gce); - if (g_chatApi.OnFlashHighlight) - g_chatApi.OnFlashHighlight(si, bInactive); - return TRUE; } // do blinking icons in tray @@ -406,7 +394,7 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight g_chatApi.DoPopup(si, gce); // do sounds and flashing - if (iEvent == GC_EVENT_MESSAGE) { + if (gce->iType & GC_EVENT_MESSAGE) { if (bInactive && !(si->wState & STATE_TALK)) { si->wState |= STATE_TALK; db_set_w(si->hContact, si->pszModule, "ApparentMode", ID_STATUS_OFFLINE); @@ -416,10 +404,13 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight } if (bInactive || !g_Settings->bSoundsFocus) - if (auto szSound = si->getSoundName(iEvent)) + if (auto szSound = si->getSoundName(gce->iType)) Skin_PlaySound(szSound); } + if (bHighlight) + if (g_chatApi.OnFlashHighlight) + g_chatApi.OnFlashHighlight(si, bInactive); return TRUE; }