diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst index 31d4e557f..77f0a8162 100644 --- a/docs/source/configuration.rst +++ b/docs/source/configuration.rst @@ -574,6 +574,8 @@ formatted sound files. We need both, because neither format is supported by all You can set the URL where the sound files are hosted with the `sounds_path`_ option. +Requires the `src/converse-notification.js` plugin. + .. _`prebind_url`: prebind_url @@ -639,6 +641,18 @@ However, be aware that even if this value is set to ``false``, if the controlbox is open, and the page is reloaded, then it will stay open on the new page as well. +.. _`show-desktop-notifications`: + +show_desktop_notifications +-------------------------- + +* Default: ``true`` + +Should HTML5 desktop notifications be shown when the browser is not visible or +blurred? + +Requires the `src/converse-notification.js` plugin. + show_only_online_users ---------------------- diff --git a/docs/source/features.rst b/docs/source/features.rst index 1b17a7024..6803e98d0 100644 --- a/docs/source/features.rst +++ b/docs/source/features.rst @@ -39,13 +39,18 @@ For now, suffice to say that although its useful to have OTR support in Converse.js in order to avoid most eavesdroppers, if you need serious communications privacy, then you're much better off using native software. -Sound Notifications -=================== +Notifications +============= From version 0.8.1 Converse.js can play a sound notification when you receive a message. -For more info, please see the :ref:`play-sounds` configuration setting. +For more info, refer to the :ref:`play-sounds` configuration setting. + +It can also show `desktop notification messages `_ +when the browser is not currently visible. + +For more info, refer to the :ref:`show-desktop-notifications` configuration setting. Multilingual Support ==================== diff --git a/index.html b/index.html index ff2ef467a..96a97af49 100644 --- a/index.html +++ b/index.html @@ -146,7 +146,8 @@
  • Roster item exchange (XEP 144)
  • Chat statuses (online, busy, away, offline)
  • Custom status messages
  • -
  • Typing and state notifications (XEP 85)
  • +
  • Typing and chat state notifications (XEP 85)
  • +
  • Desktop notification messages when the browser is not visible
  • Messages appear in all connected chat clients (XEP 280)
  • Third person "/me" messages (XEP 245)
  • XMPP Ping (XEP 199)
  • diff --git a/src/converse-notification.js b/src/converse-notification.js index 83b811228..815bc94ba 100644 --- a/src/converse-notification.js +++ b/src/converse-notification.js @@ -34,6 +34,7 @@ var converse = this.converse; // Configuration values for this plugin var settings = { + show_desktop_notifications: true, play_sounds: false, sounds_path: '/sounds/', notification_icon: '/logo/conversejs.png' @@ -113,7 +114,8 @@ * message was received. */ if (!supports_html5_notification || - this.windowState !== 'blur' || + !converse.show_desktop_notifications || + converse.windowState !== 'blur' || Notification.permission !== "granted") { return; }