[Proposal] User Availability API (Do not Disturb)

Nowadays most people have multiple messengers open at the same time. They are from different vendors and each one manages its own user availability state.

So if a user starts a call on one messenger, the availability status changes to ‘occupied’ on that messenger but not on the other ones.

It would be great if there was a JS API (and eventually also an OS API) that would manage a set of availability states for the current user and broadcasted an event to the OS whenever the state changed.

That way, when a user manually changed the status on one messenger (or in the OS), it would trigger a cascade and change the status on all open messengers.

Since most messengers are implemented with Web technologies, a JS API would make sense. Mac OS already has a ‘Do not disturb’ functionality. From what I can tell it is not a public API though.

Are there any native platforms that currently expose this state to apps? I know mac OS, iOS and Android already all have versions of this feature for system notifications, but I can’t think of any examples where apps have used this system notification-specific behavior to set a global messenger state, and i think it may be confusing to users that they can do so.

Are there any other platforms that even allow this? If there are, are there any platforms where this is a common behavior that users want? (Personally, I would be kind of surprised if it happened to me—I expect my DnD status on Mac to be somewhat private)

It sounds like the use-case for this is to disable displaying notifications when user is in DnD mode? If that is true, I think the apps can just use the Notifications API for notification and it would be up to the Browsers to determine whether user is in DnD mode and figure out what to do with notification. If that was the case, would a new JS API be necessary?