Skip to content
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

feat(user status): automate user status for events #40615

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

miaulalala
Copy link
Contributor

@miaulalala miaulalala commented Sep 25, 2023

Summary

The user status currently only takes into account the availability settings. Automatically set a user status to free or busy depending on their calendar transparency, event status and availability settings combined.

This can be done with a free/busy request just like the Calendar app does for the free/busy modal.

How to test:

THe easiest way to test is to create 5- minute calendar events and have some sort of VAVAILABLITY setting.

The decision tree is the following:

Status decision tree:

USER DEFINED STATUS

  • Persistent status such as DND, OFFLINE, INVISIBLE?
    • leave the status alone
  • Not persistent?
    • get Calendar status
      • calendar checks for events (BUSY) and availability (within the availability and no event = ONLINE, event = AWAY + in a meeting status, outside availability = BUSY + away status)
      • calendar reports identical to existing status (i.e. online == online)
      • calendar status is different (i. e. user has status ONLINE but calendar reports AWAY or BUSY)
        • process the new calendar status - in a meeting if a event is happening, away if outside availability

NOT USER DEFINED

  • get calendar status
  • process the new calendar status - in a meeting if a event is happening, away if outside availability

TODO

  • tests

Checklist

@miaulalala miaulalala self-assigned this Sep 25, 2023
@miaulalala miaulalala added 2. developing Work in progress feature: status feature: caldav Related to CalDAV internals enhancement pending documentation This pull request needs an associated documentation update labels Sep 25, 2023
@miaulalala miaulalala added this to the Nextcloud 28 milestone Sep 25, 2023
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

Psalm found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

@miaulalala miaulalala force-pushed the enh/automate-calendar-event-user-status branch from fca0790 to f4cfa4d Compare October 3, 2023 14:43
@miaulalala miaulalala force-pushed the enh/automate-calendar-event-user-status branch from 8e8911b to d307b47 Compare October 12, 2023 21:16
@miaulalala

This comment was marked as off-topic.

@miaulalala
Copy link
Contributor Author

Having nextcloud/calendar#3193 would be good @ChristophWurst - shall I add it as a followup?

Context:
image

@nimishavijay

This comment was marked as off-topic.

@jancborchardt

This comment was marked as off-topic.

@miaulalala

This comment was marked as off-topic.

@nimishavijay
Copy link
Member

I think the status alignment with teams needs to be a separate ticket and is not within the scope of this feature.

Would it not be possible to just change the icons for all the statuses?
New icons:
Available: check-circle in --color-success
Busy: circle in --color-error
Away: watch-later in --color-warning
DND: do-not-disturb-on in --color-error
Offline: trip-origin in --color-text-maxcontrast

@jancborchardt
Copy link
Member

Agree with @nimishavijay. If that is out of scope, a good first step would be to just do the same that we do when in a call – which is not changing the status, only emoji and status text, right @nickvergessen?

@nickvergessen
Copy link
Member

which is not changing the status, only emoji and status text, right

We do change the status to "Away" (when the user was not invisible (=> no status change) or DND (=> in call with DND))
https://github.com/nextcloud/spreed/blob/3ce5c7bdaafeb8f4747f7bc05e60ebd33ada192a/lib/Status/Listener.php#L55-L83

@miaulalala
Copy link
Contributor Author

Agree with @nimishavijay. If that is out of scope, a good first step would be to just do the same that we do when in a call – which is not changing the status, only emoji and status text, right @nickvergessen?

Aight, chaningin the status to "away" for now, and removing the icons. Follow up ticket for icon changes discussion here:#41299

@blizzz blizzz mentioned this pull request Nov 6, 2023
@miaulalala miaulalala marked this pull request as ready for review November 8, 2023 16:41
@miaulalala miaulalala requested a review from st3iny November 8, 2023 16:41
@ChristophWurst ChristophWurst added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Nov 8, 2023
Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

Code looks good

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

Worked for my local instance once I cleared the Away override and the custom status message

@miaulalala miaulalala force-pushed the enh/automate-calendar-event-user-status branch from 23fbe23 to ab261fc Compare November 8, 2023 19:19
@miaulalala miaulalala force-pushed the enh/automate-calendar-event-user-status branch 3 times, most recently from e358b7b to 1661393 Compare November 9, 2023 11:38
@miaulalala miaulalala force-pushed the enh/automate-calendar-event-user-status branch from 1661393 to fc9f805 Compare November 9, 2023 14:45
and automatically set a user status to free or busy depending on their calendar
transparency, event status and availability settings

Signed-off-by: Anna Larch <[email protected]>
@miaulalala miaulalala force-pushed the enh/automate-calendar-event-user-status branch from fc9f805 to f14a4f8 Compare November 9, 2023 15:20
@miaulalala
Copy link
Contributor Author

Failing Cypress test: theming/admin-settings.cy.ts (unrelated)

@ChristophWurst ChristophWurst merged commit 7248d9b into master Nov 9, 2023
48 of 50 checks passed
@ChristophWurst ChristophWurst deleted the enh/automate-calendar-event-user-status branch November 9, 2023 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement feature: caldav Related to CalDAV internals feature: status pending documentation This pull request needs an associated documentation update
Projects
Development

Successfully merging this pull request may close these issues.

Set user status to busy when own calendar contains busy event
7 participants