-
Notifications
You must be signed in to change notification settings - Fork 35
Add group chat snooze menu back from history #339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1345,7 +1345,12 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, | |
| // should happen after you get an "invitation" | ||
| if (!gIMMgr->hasSession(session_id)) | ||
| { | ||
| return; | ||
| if (!gAgent.isInGroup(session_id) || | ||
| !gIMMgr->checkSnoozeExpiration(session_id) || | ||
| !gIMMgr->restoreSnoozedSession(session_id)) | ||
| { | ||
| return; | ||
| } | ||
| } | ||
|
|
||
| else if (offline == IM_ONLINE && is_do_not_disturb) | ||
|
Comment on lines
1346
to
1356
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win Process the message after restoring the snoozed session. When 🐛 Proposed fix if (!gIMMgr->hasSession(session_id))
{
if (!gAgent.isInGroup(session_id) ||
!gIMMgr->checkSnoozeExpiration(session_id) ||
!gIMMgr->restoreSnoozedSession(session_id))
{
return;
}
}
- else if (offline == IM_ONLINE && is_do_not_disturb)
+ if (offline == IM_ONLINE && is_do_not_disturb)
{Also applies to: 1389-1415 🤖 Prompt for AI Agents |
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3556,7 +3556,17 @@ bool LLIMMgr::leaveSession(const LLUUID& session_id) | |||||||||||||||||||||||||||||
| LLIMModel::LLIMSession* im_session = LLIMModel::getInstance()->findIMSession(session_id); | ||||||||||||||||||||||||||||||
| if (!im_session) return false; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| LLIMModel::getInstance()->sendLeaveSession(session_id, im_session->mOtherParticipantID); | ||||||||||||||||||||||||||||||
| if (im_session->isGroupSessionType() && im_session->mCloseAction == LLIMModel::LLIMSession::SCloseAction::CLOSE_SNOOZE) | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| const F64 duration = llmax(0, im_session->mSnoozeDuration); | ||||||||||||||||||||||||||||||
| mSnoozedSessions[session_id] = LLTimer::getTotalSeconds() + duration; | ||||||||||||||||||||||||||||||
|
Comment on lines
+3561
to
+3562
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Preserve the “next relog” sentinel instead of expiring it immediately.
🐛 Proposed fix- const F64 duration = llmax(0, im_session->mSnoozeDuration);
- mSnoozedSessions[session_id] = LLTimer::getTotalSeconds() + duration;
+ const S32 duration = im_session->mSnoozeDuration;
+ mSnoozedSessions[session_id] = duration < 0
+ ? -1.0 // in-memory only: snoozed until next relog
+ : LLTimer::getTotalSeconds() + duration;- return it != mSnoozedSessions.end() && it->second <= LLTimer::getTotalSeconds();
+ return it != mSnoozedSessions.end()
+ && it->second >= 0.0
+ && it->second <= LLTimer::getTotalSeconds();Also applies to: 3760-3763 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| LLIMModel::getInstance()->sendLeaveSession(session_id, im_session->mOtherParticipantID); | ||||||||||||||||||||||||||||||
| mSnoozedSessions.erase(session_id); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| gIMMgr->removeSession(session_id); | ||||||||||||||||||||||||||||||
| return true; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
@@ -3747,6 +3757,45 @@ bool LLIMMgr::hasSession(const LLUUID& session_id) | |||||||||||||||||||||||||||||
| return LLIMModel::getInstance()->findIMSession(session_id) != NULL; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| bool LLIMMgr::checkSnoozeExpiration(const LLUUID& session_id) const | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| snoozed_sessions_t::const_iterator it = mSnoozedSessions.find(session_id); | ||||||||||||||||||||||||||||||
| return it != mSnoozedSessions.end() && it->second <= LLTimer::getTotalSeconds(); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| bool LLIMMgr::isSnoozedSession(const LLUUID& session_id) const | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| return mSnoozedSessions.find(session_id) != mSnoozedSessions.end(); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| bool LLIMMgr::restoreSnoozedSession(const LLUUID& session_id) | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| snoozed_sessions_t::iterator it = mSnoozedSessions.find(session_id); | ||||||||||||||||||||||||||||||
| if (it == mSnoozedSessions.end()) | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| return false; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| mSnoozedSessions.erase(it); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| LLGroupData group_data; | ||||||||||||||||||||||||||||||
| if (!gAgent.getGroupData(session_id, group_data)) | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| return false; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
Comment on lines
+3779
to
+3785
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Don’t consume snooze state before restoration can succeed. If 🐛 Proposed fix- mSnoozedSessions.erase(it);
-
LLGroupData group_data;
if (!gAgent.getGroupData(session_id, group_data))
{
return false;
}
+
+ mSnoozedSessions.erase(it);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| gIMMgr->addSession(group_data.mName, IM_SESSION_GROUP_START, session_id); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| uuid_vec_t ids; | ||||||||||||||||||||||||||||||
| LLIMModel::sendStartSession(session_id, session_id, ids, IM_SESSION_GROUP_START, false); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| if (!gAgent.isDoNotDisturb()) | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| make_ui_sound("UISndStartIM"); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| return true; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| void LLIMMgr::clearPendingInvitation(const LLUUID& session_id) | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| if ( mPendingInvitations.has(session_id.asString()) ) | ||||||||||||||||||||||||||||||
|
|
@@ -4441,4 +4490,3 @@ LLHTTPRegistration<LLViewerChatterBoxSessionUpdate> | |||||||||||||||||||||||||||||
| LLHTTPRegistration<LLViewerChatterBoxInvitation> | ||||||||||||||||||||||||||||||
| gHTTPRegistrationMessageChatterBoxInvitation( | ||||||||||||||||||||||||||||||
| "/message/ChatterBoxInvitation"); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
Repository: AlchemyViewer/Alchemy
Length of output: 8096
🏁 Script executed:
Repository: AlchemyViewer/Alchemy
Length of output: 12670
🏁 Script executed:
Repository: AlchemyViewer/Alchemy
Length of output: 50377
🏁 Script executed:
Repository: AlchemyViewer/Alchemy
Length of output: 3096
Next relogneeds persistent snooze handling.value="-1"still callsleaveIM, while snooze state is only kept inmSnoozedSessionsin memory. If this option is meant to mute the group until the next login, it needs a persistent restore path; otherwise the label is misleading.🤖 Prompt for AI Agents