XEP-0492: Chat notification settings

Abstract
This document defines an XMPP protocol extension to synchronise per-chat notification settings across different clients.
Author
Nicolas Cedilnik
Copyright
© 2024 – 2024 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status

Experimental

WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems are advised to carefully consider whether it is appropriate to deploy implementations of this protocol before it advances to a status of Draft.
Type
Standards Track
Version
0.1.0 (2024-07-01)
Document Lifecycle
  1. Experimental
  2. Proposed
  3. Stable
  4. Final

1. Introduction

"Notifications" are (usually) pop-up windows that appear in a visible area of the screen even when the emitting application is in the background, often triggering a sound alert. Instant messaging clients expectedly use notifications to inform users when they receive a message.

Users may want to customise which conversations should trigger notifications and under which conditions. In practice, this is already implemented in many instant messaging clients, including XMPP clients. This specification proposes a mechanism to synchronise per-discussion notification settings across different XMPP clients.

2. Protocol

2.1 The notify element

Notification settings are represented by the <notify> element. This element MUST be a child of an element identifying a specific chat by its JID, such as a PEP Native Bookmarks (XEP-0402) [1] <extensions>.

This protocol specifies three children for the <notify> element, each corresponding to a notification setting: <always> <on-mention> and <never>.

Example 1. Most basic example
<notify xmlns='urn:xmpp:notification-settings:0'>
  <never />
</notify>

2.2 Client types

One might want to choose different notification settings depending on the client type. In this case, a "client-type" attribute can be added to the notification setting, using registered Service Discovery Identities.

Example 2. An example of notification settings by client type
<notify xmlns='urn:xmpp:notification-settings:0'>
  <never client-type="pc" />
  <on-mention client-type="mobile" />
</notify>

2.3 Advanced notification settings

Finally, clients can use this specification to synchronise finer-grained notification settings using custom namespaces.

Example 3. An example of notification settings by client type
<notify xmlns='urn:xmpp:notification-settings:0'>
  <never client-type="pc" />
  <on-mention client-type="mobile" />
  <advanced>
    <custom-extension xmlns="custom:ns-1">
      <when day-of-week="monday">night-time-only</day-of-week>
      ...
    </custom-extension">
    <custom-extension-2 xmlns="custom:ns-2">
      <weather>raining</weather>
      ...
    </custom-extension-2">
  </advanced>
</notify>

3. Business Rules

Entities implementing this specification MUST NOT delete or alter the advanced notification settings they do not support when updating the notification settings for a given chat.

If there is more than one notification setting for a given chat, entities implementing this specification MUST specify which client type they apply to. The (notification setting, client-type) pairs MUST be unique.

Entities using advanced notification settings SHOULD attempt to provide the basic notification setting which is the closest to what they offer as a fallback for other entities.

The "on-mention" notification MAY rely on the user's nickname being spelled out in an incoming message in a group chat, but SHOULD rely on mechanisms to explicitly "ping" the user, such as a Message Replies (XEP-0461) [2] element referring a user's previous message or a specific mention, such as a References (XEP-0372) [3] mention.

In the absence of a notification settings for a given chat, "always" SHOULD be assumed for direct chats and private group chats, and "on-mention" for public group chats.

4. Security Considerations

See considerations in PEP Native Bookmarks (XEP-0402) [1].

5. IANA Considerations

This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [4].

6. XMPP Registrar Considerations

6.1 Protocol Namespaces

This specification defines the following XML namespace:

The XMPP Registrar [5] includes this namespace in the registry located at <https://xmpp.org/registrar/namespaces.html>, as described in Section 4 of XMPP Registrar Function (XEP-0053) [6].

6.2 Protocol Versioning

If the protocol defined in this specification undergoes a revision that is not fully backwards-compatible with an older version, the XMPP Registrar shall increment the protocol version number found at the end of the XML namespaces defined herein, as described in Section 4 of XEP-0053.

7. XML Schema

<?xml version='1.0' encoding='UTF-8'?>

<xs:schema
    xmlns:xs='http://www.w3.org/2001/XMLSchema'
    targetNamespace='urn:xmpp:notification-settings:0'
    xmlns='urn:xmpp:notification-settings:0'
    elementFormDefault='qualified'>

  <xs:annotation>
    <xs:documentation>
      The protocol documented by this schema is defined in
      XEP-0492: http://www.xmpp.org/extensions/xep-0492.html
    </xs:documentation>
  </xs:annotation>

  <xs:element name='notify'>
    <xs:complexType>
      <xs:attribute name='when' default='always'>
        <xs:restriction base='xs:NCName'>
          <xs:enumeration value='always'/>
          <xs:enumeration value='never'/>
          <xs:enumeration value='on-mention'/>
        </xs:restriction>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
</xs:schema>

Appendices

Appendix A: Document Information

Series
XEP
Number
0492
Publisher
XMPP Standards Foundation
Status
Experimental
Type
Standards Track
Version
0.1.0
Last Updated
2024-07-01
Approving Body
XMPP Council
Dependencies
XMPP Core, XMPP IM, XEP-0163
Supersedes
None
Superseded By
None
Short Name
notification-settings
Source Control
HTML

This document in other formats: XML  PDF

Appendix B: Author Information

Nicolas Cedilnik
Email
nicoco@nicoco.fr
JabberID
nicoco@nicoco.fr

Copyright

This XMPP Extension Protocol is copyright © 1999 – 2024 by the XMPP Standards Foundation (XSF).

Permissions

Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.

Disclaimer of Warranty

## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##

Limitation of Liability

In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.

IPR Conformance

This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).

Visual Presentation

The HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.

Appendix D: Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.

Appendix E: Discussion Venue

The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.

Discussion on other xmpp.org discussion lists might also be appropriate; see <https://xmpp.org/community/> for a complete list.

Errata can be sent to <editor@xmpp.org>.

Appendix F: Requirements Conformance

The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".

Appendix G: Notes

1. XEP-0402: PEP Native Bookmarks <https://xmpp.org/extensions/xep-0402.html>.

2. XEP-0461: Message Replies <https://xmpp.org/extensions/xep-0461.html>.

3. XEP-0372: References <https://xmpp.org/extensions/xep-0372.html>.

4. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.

5. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <https://xmpp.org/registrar/>.

6. XEP-0053: XMPP Registrar Function <https://xmpp.org/extensions/xep-0053.html>.

Appendix H: Revision History

Note: Older versions of this specification might be available at https://xmpp.org/extensions/attic/

  1. Version 0.1.0 (2024-07-01)
    XEP Editor: dg
  2. Version 0.0.2 (2024-06-08)

    Update after discussions on the standards@ mailing list.

    nc
  3. Version 0.0.1 (2024-06-06)

    Initial version.

    nc

Appendix I: Bib(La)TeX Entry

@report{cedilnik2024notification-settings,
  title = {Chat notification settings},
  author = {Cedilnik, Nicolas},
  type = {XEP},
  number = {0492},
  version = {0.1.0},
  institution = {XMPP Standards Foundation},
  url = {https://xmpp.org/extensions/xep-0492.html},
  date = {2024-06-06/2024-07-01},
}

END