From 530388c7a77d9396fe0c0d73b1784ee0d3083bf2 Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Sun, 9 Apr 2023 22:53:09 -0400 Subject: [PATCH] Decruft --- indra/newview/llimprocessing.cpp | 3 +-- indra/newview/llimview.cpp | 15 ++++++++------- indra/newview/llimview.h | 4 ---- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index 67c7d5058c2..5ee6ee846e7 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -1241,7 +1241,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, // should happen after you get an "invitation" // if (!gIMMgr->hasSession(session_id)) // [SL:KB] - Patch: Chat-GroupSnooze | Checked: Catznip-3.3 - if ( (!gIMMgr->hasSession(session_id)) && ( (!gAgent.isInGroup(session_id)) || (!gIMMgr->checkSnoozeExpiration(session_id)) || (!gIMMgr->restoreSnoozedSession(session_id)) ) ) + if (!gIMMgr->hasSession(session_id) && (!gAgent.isInGroup(session_id) || (!gIMMgr->checkSnoozeExpiration(session_id) || !gIMMgr->restoreSnoozedSession(session_id))) ) // [/SL:KB] { return; @@ -1845,7 +1845,6 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url) from_group = message_data["from_group"].asString() == "Y"; } - LLIMProcessing::processNewMessage( message_data["from_agent_id"].asUUID(), from_group, diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 030939e924d..54b29cd5b0d 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1652,9 +1652,6 @@ LLIMModel::LLIMSession* LLIMModel::addMessageSilently(const LLUUID& session_id, || INTERACTIVE_SYSTEM_FROM == from) { ++(session->mParticipantUnreadMessageCount); -// [SL:KB] - Patch: Chat-GroupSnooze | Checked: Catznip-3.3 - session->mParticipantLastMessageTime = LLDate::now(); -// [/SL:K] } return session; @@ -3452,11 +3449,12 @@ bool LLIMMgr::leaveSession(const LLUUID& session_id) nSnoozeDuration = ((pOptions) && (pOptions->mSnoozeOnClose)) ? pOptions->mSnoozeDuration * 60 : s_nSnoozeTime; } + F64 expirationTime = LLTimer::getTotalSeconds() + F64(nSnoozeDuration); snoozed_sessions_t::iterator itSession = mSnoozedSessions.find(session_id); if (mSnoozedSessions.end() != itSession) - itSession->second = im_session->mParticipantLastMessageTime.secondsSinceEpoch() + static_cast<F64>(nSnoozeDuration); + itSession->second = expirationTime; else - mSnoozedSessions.emplace(session_id, im_session->mParticipantLastMessageTime.secondsSinceEpoch() + static_cast<F64>(nSnoozeDuration)); + mSnoozedSessions.emplace(session_id, expirationTime); } else { @@ -3653,7 +3651,7 @@ BOOL LLIMMgr::hasSession(const LLUUID& session_id) bool LLIMMgr::checkSnoozeExpiration(const LLUUID& session_id) const { snoozed_sessions_t::const_iterator itSession = mSnoozedSessions.find(session_id); - return (mSnoozedSessions.end() != itSession) && (itSession->second < LLTimer::getTotalSeconds()); + return (mSnoozedSessions.end() != itSession) && (itSession->second <= LLTimer::getTotalSeconds()); } bool LLIMMgr::isSnoozedSession(const LLUUID& session_id) const @@ -3676,7 +3674,10 @@ bool LLIMMgr::restoreSnoozedSession(const LLUUID& session_id) uuid_vec_t ids; LLIMModel::sendStartSession(session_id, session_id, ids, IM_SESSION_GROUP_START); - make_ui_sound("UISndStartIM"); + if(!gAgent.isDoNotDisturb()) + { + make_ui_sound("UISndStartIM"); + } return true; } } diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 5785f8ef4d8..8476504bb64 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -145,10 +145,6 @@ class LLIMModel final : public LLSingleton<LLIMModel> // connection to voice channel state change signal boost::signals2::connection mVoiceChannelStateChangeConnection; -// [SL:KB] - Patch: Chat-GroupSnooze | Checked: Catznip-3.3 - LLDate mParticipantLastMessageTime = LLDate::now(); -// [/SL:KB] - //does NOT include system messages and agent's messages S32 mParticipantUnreadMessageCount; -- GitLab