Skip to content

Conversation

@AshutoshKhadse23
Copy link

@AshutoshKhadse23 AshutoshKhadse23 commented Jan 15, 2026

Screenshots:

Screenshot 2026-01-15 at 7 37 34 PM Screenshot 2026-01-15 at 7 38 00 PM simulator_screenshot_7D7DF2EA-7E96-474D-9466-027CEBB5ED6C

Demo is not possible as web//server is not merged yet

Closes #1944

Add the scheduledEndTime field to UserStatusChange to support the
scheduled_end_time API parameter. This allows users to set a time
at which their status will be automatically cleared by the server.

The field is an Option<int?> representing a Unix timestamp in seconds:
- OptionNone: no change to the scheduled end time
- OptionSome(value): set the scheduled end time to value
- OptionSome(null): clear any existing scheduled end time

Changes:
- Add scheduledEndTime field to UserStatusChange
- Add _scheduledEndTimeFromJson parsing method
- Update toJson to serialize the field
- Update copyWith to include scheduledEndTime
Update the updateStatus API call to include the scheduled_end_time
parameter when present in UserStatusChange.

This allows the server to store when the user's status should be
automatically cleared.
Add localization strings for the status expiration dropdown:
- statusExpirationLabel: "Automatically clear status"
- statusExpirationNever: "Never"
- statusExpirationIn30Minutes: "In 30 minutes"
- statusExpirationIn1Hour: "In 1 hour"
- statusExpirationTodayAtTime: "Today at {time}"
- statusExpirationTomorrow: "Tomorrow"
- statusExpirationCustom: "Custom"
Add a dropdown to the set status page that allows users to set when
their status should automatically expire. The dropdown appears below
the status suggestions.

Options:
- Never (default for custom statuses)
- In 30 minutes
- In 1 hour
- Today at 5:00 PM
- Tomorrow
- Custom (opens date/time picker)

When a preset status is selected, the expiration is automatically
set based on the status type:
- Busy, In a meeting: In 1 hour
- Commuting: In 30 minutes
- Out sick: Tomorrow
- Vacationing: Never
- Working remotely, At the office: Today at 5 PM

The time format respects the user's 24-hour time preference.

The actual clearing of expired statuses happens server-side via
the clear_user_status background job.

Fixes: zulip#1944
@AshutoshKhadse23
Copy link
Author

@gnprice, This is the PR for review. I have corrected and cleaned the commit history as well as added screenshots. Please let me know if any changes are needed after review - I'm open to feedback.

@AshutoshKhadse23 AshutoshKhadse23 marked this pull request as draft January 16, 2026 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make it possible to set a status end time

1 participant