Skip to content

Add group chat snooze menu back from history#339

Open
nacklequack wants to merge 4 commits into
AlchemyViewer:developfrom
nacklequack:feature/group-chat-snooze
Open

Add group chat snooze menu back from history#339
nacklequack wants to merge 4 commits into
AlchemyViewer:developfrom
nacklequack:feature/group-chat-snooze

Conversation

@nacklequack

Copy link
Copy Markdown
Contributor

Description

Adds the group chat snooze flyout/menu back to group IM sessions on develop.

This restores the small group chat toolbar menu that allows a group conversation to be snoozed for:

  • Next message
  • 5 minutes
  • 15 minutes
  • 30 minutes
  • 45 minutes
  • 1 hour
  • Next relog

The implementation ports the group-chat floater/action/session pieces from the older main history into the current develop IM/session code. It tracks snoozed group sessions locally, suppresses reopening while the snooze is active, and restores the group session when a message arrives after the snooze expires.

image

Historical attribution/context:

  • Based primarily on old main commit be67f0cd6c06 by @RyeMutt: “Port Catznip's snooze group feature”.
  • That commit itself credits Catznip as the original source of the group snooze feature.
  • This branch builds on group muting work already present on develop, including 2c15baf8b5 by @cinderblocks/@RyeMutt , originally from Katherine Berry, and follow-up ced1e6ed9b by Rye for muted group chat session behavior.
  • I intentionally did not restore the older group profile/options behavior around snoozing on close, because later old-main commits f804d2e7f80d / 821bc5b960fe by @RyeMutt partially backed out/adjusted that area. This PR is scoped to the explicit group chat toolbar snooze menu.

Checklist

Please ensure the following before requesting review:

  • I have provided a clear title and detailed description for this pull request.
  • If useful, I have included media such as screenshots and video to show off my changes.
  • I have tested the changes locally and verified they work as intended.
  • All new and existing tests pass.
  • Code follows the project's style guidelines.
  • Documentation has been updated if needed.
  • Any dependent changes have been merged and published in downstream modules
  • I have reviewed the contributing guidelines.

Additional Notes

Local verification completed:

.\.venv\Scripts\Activate.ps1
cmake --build build-Windows-vs2026-os --config Release

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 606264d3-24e5-403c-9231-c6218c354348

📥 Commits

Reviewing files that changed from the base of the PR and between 604134e and 5470b2c.

📒 Files selected for processing (1)
  • indra/newview/llimview.cpp

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added a group chat snooze flyout with preset durations (Next message, 5/15/30/45 minutes, 1 hour) and “Next relog.”
    • Snoozed group conversations are restored automatically when appropriate.
  • Bug Fixes

    • Improved processing of incoming group chat sessions so snoozed conversations aren’t dropped.
    • Leaving a group chat now honors the selected close action, including snoozing.

Walkthrough

This PR adds group IM snoozing with close-action state, expiration tracking, restoration on incoming messages, and a toolbar flyout for selecting snooze durations. Group action APIs now distinguish leaving from snoozing.

Changes

Group IM Snooze

Layer / File(s) Summary
Session close-action and snooze data model
indra/newview/llimview.h
Adds close-action values, snooze duration state, snoozed-session storage, and LLIMMgr snooze method declarations.
Group action entry points for leave and snooze
indra/newview/llgroupactions.*
Adds shared group-session closing logic and public leaveIM and snoozeIM methods.
Snoozed session lifecycle and restoration
indra/newview/llimview.cpp
Stores snooze expirations without sending leave events, restores valid group sessions, and removes the invitation registration.
Incoming message restoration
indra/newview/llimprocessing.cpp
Attempts snoozed-session restoration for eligible group messages when no session is open.
Snooze toolbar integration
indra/newview/llfloaterimsession.*, indra/newview/skins/default/xui/en/floater_im_session.xml
Adds duration selections, parses snooze values, and wires the toolbar callback to snoozeIM.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant LLFloaterIMSession
  participant LLGroupActions
  participant LLIMMgr
  participant LLIMProcessing

  User->>LLFloaterIMSession: Select snooze duration
  LLFloaterIMSession->>LLGroupActions: snoozeIM(group_id, duration)
  LLGroupActions->>LLIMMgr: leaveSession(session_id) with snooze state
  LLIMMgr->>LLIMMgr: Store expiration in mSnoozedSessions
  LLIMProcessing->>LLIMMgr: Check expiration and restore session
  LLIMMgr->>LLIMMgr: addSession and sendStartSession
  LLIMMgr-->>LLIMProcessing: Restored group session
Loading

Suggested reviewers: roxanneskelly, ryemutt

Poem

A rabbit clicks snooze, soft and bright,
The group chat rests through day and night.
New words arrive, the session springs—
Back to the burrow on quick paws and wings. 🐇💤

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: restoring the group chat snooze menu.
Description check ✅ Passed The description covers the change, context, screenshots, testing, and checklist; the related issue link is the only notable omission.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
indra/newview/llfloaterimsession.cpp (1)

288-300: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Minor: naming typo and cast robustness.

  • boost::lexical_cast<S32>(value) will throw bad_lexical_cast if getValue() ever returns a non-numeric string; since values are hardcoded in the XML this is low risk today but fragile against future edits (e.g., adding a non-numeric flyout item value).
  • The control name snooze_groupt_btn (typo for "group") is used both here (implicitly via caller) and in the XML; worth fixing for consistency, though it's an internal identifier only.

Consider using LLStringUtil::convertToS32 or wrapping the cast in a try/catch for defensive robustness against malformed values.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@indra/newview/llfloaterimsession.cpp` around lines 288 - 300, The snooze-time
handling in llfloaterimsession.cpp is too fragile because llfloaterIMSession’s
use of boost::lexical_cast<S32>(value) can throw if the control value ever
becomes non-numeric. Update the logic in the value-handling branch to use a
safer conversion path such as LLStringUtil::convertToS32 or a guarded try/catch,
and keep the LLGroupActions::leaveIM/snoozeIM behavior unchanged for the
existing "-1", empty, and numeric cases. Also rename the internal control
identifier snooze_groupt_btn to the consistent group spelling in both the UI XML
and any code that references it.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@indra/newview/llfloaterimsession.cpp`:
- Around line 281-302: The LLFloaterIMSession::onSnoozeGroupClicked handler
treats the “Next relog” option as leaveIM and only stores snooze state in
mSnoozedSessions, so update the snooze flow to persist a true “mute until next
login” state instead of using a transient in-memory flag. Add a restore path for
that persistent state when sessions are recreated, and keep the existing snooze
durations for the other value cases while ensuring the value="-1" branch maps to
the new persistent snooze behavior rather than leaving the IM session.

In `@indra/newview/llimprocessing.cpp`:
- Around line 1346-1356: The message handling in the block using hasSession,
checkSnoozeExpiration, and restoreSnoozedSession drops the incoming message
after a snoozed session is successfully restored because control flow exits the
hasSession branch before the later offline/is_do_not_disturb handling. Update
this logic so a successful restore continues into the normal message-processing
path instead of returning or skipping the rest of the function, and make the
same change in the duplicated code path referenced by the other affected
section.

In `@indra/newview/llimview.cpp`:
- Around line 3561-3562: The snooze handling in llimview.cpp is collapsing the
“next relog” sentinel because llmax(0, im_session->mSnoozeDuration) turns
mSnoozeDuration == -1 into an immediately expired timer. Update the snooze
calculation in the code paths that assign mSnoozedSessions for both the session
state in llimview.cpp so that the sentinel value is preserved and treated as
“snoozed until logout,” while only finite snooze durations are converted into a
timestamp-based expiry. Use the existing im_session and mSnoozedSessions logic
as the anchor points when applying the fix.
- Around line 3779-3785: The snooze entry is being removed before restoration is
confirmed, so a failed getGroupData() call leaves the session permanently
unsnoozed. Update the snoozed-session restoration flow in the logic that uses
mSnoozedSessions and gAgent.getGroupData() so the erase only happens after group
data has been successfully retrieved and the session can actually be restored.
Keep the existing false return path, but preserve the snooze state when
restoration cannot proceed.

---

Nitpick comments:
In `@indra/newview/llfloaterimsession.cpp`:
- Around line 288-300: The snooze-time handling in llfloaterimsession.cpp is too
fragile because llfloaterIMSession’s use of boost::lexical_cast<S32>(value) can
throw if the control value ever becomes non-numeric. Update the logic in the
value-handling branch to use a safer conversion path such as
LLStringUtil::convertToS32 or a guarded try/catch, and keep the
LLGroupActions::leaveIM/snoozeIM behavior unchanged for the existing "-1",
empty, and numeric cases. Also rename the internal control identifier
snooze_groupt_btn to the consistent group spelling in both the UI XML and any
code that references it.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b2a332db-80d2-46e3-aba4-5a95a34fa016

📥 Commits

Reviewing files that changed from the base of the PR and between 43e3ae0 and 2f447de.

📒 Files selected for processing (8)
  • indra/newview/llfloaterimsession.cpp
  • indra/newview/llfloaterimsession.h
  • indra/newview/llgroupactions.cpp
  • indra/newview/llgroupactions.h
  • indra/newview/llimprocessing.cpp
  • indra/newview/llimview.cpp
  • indra/newview/llimview.h
  • indra/newview/skins/default/xui/en/floater_im_session.xml

Comment thread indra/newview/llfloaterimsession.cpp
Comment thread indra/newview/llimprocessing.cpp Outdated
Comment thread indra/newview/llimview.cpp Outdated
Comment thread indra/newview/llimview.cpp Outdated
@nacklequack

Copy link
Copy Markdown
Contributor Author

I'm out of town, but will fix these up next week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant