nioc / xmpp-web

Lightweight web chat client for XMPP server
GNU Affero General Public License v3.0
142 stars 20 forks source link

Message notifications #59

Closed vladosam closed 1 year ago

vladosam commented 2 years ago

It would be great if we could get notifications when xmpp-web page is not active or browser is minimised.

nioc commented 2 years ago

I agree. You mean something like this: https://developer.mozilla.org/en-US/docs/Web/API/notification?

nioc commented 2 years ago

What I think for it:

I do not know if you can catch that the browser is minimized?

This works wells with #57 for which I will add a timer for inactivity. But may be it is not a good idea to use the same mechanisms as some users may want to deactivated chat state... 🤔

vladosam commented 2 years ago

What I think for it:

  • ask permission on main page (after login),
  • notify user when he receives a message (chat and groupchat ?) and the app (page) is not currently displayed.

I do not know if you can catch that the browser is minimized?

This works wells with #57 for which I will add a timer for inactivity. But may be it is not a good idea to use the same mechanisms as some users may want to deactivated chat state... 🤔

Yes, some pop-up notifications for missed messages with missed message counter on tab. Maybe with sound?

nioc commented 2 years ago

That sounds good: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API

OK for counter on title.

nioc commented 2 years ago

It is existing in VueUse:

nioc commented 1 year ago

I propose the following: