XEP-0298: Notification Inbox

Abstract:This document defines a protocol to manage a notification inbox for pending events.
Author:Valérian Saliou
Copyright:© 1999 - 2011 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status:Experimental
Type:Standards Track
Version:0.1
Last Updated:2011-05-06

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.


Table of Contents


1. Introduction
2. Requirements
3. Protocol
    3.1. Notification types
    3.2. Publishing a notification
    3.3. Receiving a notification
    3.4. Removing a notification
    3.5. Emptying notifications
4. Security Considerations
5. XML Schema
6. Acknowledgements

Appendices
    A: Document Information
    B: Author Information
    C: Legal Notices
    D: Relation to XMPP
    E: Discussion Venue
    F: Requirements Conformance
    G: Notes
    H: Revision History


1. Introduction

When interacting with an user, like replying to some comments or adding photo tags, this remote user has no way to get notifications of what happen about him. This specification defines a method for managing such notifications.

2. Requirements

The user who will receive notifications MUST:

In order to get incoming notifications in real-time, the client MAY advertise support for "urn:xmpp:inbox+notify" in its Entity Capabilities [1] data.

Clients that provide notifications inbox support MAY request all the "urn:xmpp:inbox" node items on the user's PEP service.

3. Protocol

3.1 Notification types

If the event to notify is listed in the following array, the client MUST consider using the defined event type:

Table 1: Notification types

Type Name Definition
comment The sender replied to some comments.
like The sender liked an item.
quote The sender quoted the user in a post.
wall The sender published an entry on the user's wall.
photo The sender tagged the user in a photo.
video The sender tagged the user in a video.

3.2 Publishing a notification

If Romeo wants to notify all the users who posted a comment in a comment node, his client MUST send a payload to every user's PEP node.

The notification type is stored in the "title" attribute of the "link" element, also containing the URI ("href" attribute) to the target item. The notification text content is stored in the "content" element.

Example 1. Publishing a notification

<iq from='romeo@montague.lit/mobile'
    id='pub1'
    to='juliet@capulet.lit'
    type='set'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <publish node='urn:xmpp:inbox'>
      <item id='9844f81e1408f6ecb932137d33bed7cfdcf518a3'>
        <entry xmlns='http://www.w3.org/2005/Atom'>
          <source>
            <author>
              <name>Romeo Montague</name>
              <uri>xmpp:romeo@montague.lit</uri>
            </author>
          </source>
          <content type="text">May I bring my horse?</content>
          <link rel="via" title="comment" href="xmpp:benvolio@montague.lit?;node=urn%3Axmpp%3Amicroblog%3A0%3Acomments%3A97b64c89747aecbc8077cdab941d92be;item=f3fea3c068f66fee8b66673a6ccd78b6">
          <published>2011-05-06T13:31:51Z</published>
        </entry>
      </item>
    </publish>
  </pubsub>
</iq>
    

3.3 Receiving a notification

Juliet tagged Romeo in a photo. Romeo's client gets pushed of the new item:

Example 2. Receiving a notification

<message to='romeo@montague.lit'
         from='juliet@capulet.lit'
         type='headline'>
  <event xmlns='http://jabber.org/protocol/pubsub#event'>
    <items node='urn:xmpp:inbox'>
      <item id='6728ffa81dddf38d375eb3d86e3f70086a41db65'>
        <entry xmlns='http://www.w3.org/2005/Atom'>
          <source>
            <author>
              <name>Juliet Capulet</name>
              <uri>xmpp:juliet@capulet.lit</uri>
            </author>
          </source>
          <content type='text'>Hiking with Romeo</content>
          <link rel="via" title="photo" href="xmpp:juliet@capulet.lit?;node=urn%3Axmpp%3Aalbum%2Fa73933b0408af49f1305cb47a4bb10d7913f0fd0;item=6a18f571bc9b92a442aa80ad2649b0679c8e7b30">
          <published>2011-05-06T14:39:43Z</published>
        </entry>
      </item>
    </items>
  </event>
</message>
    

3.4 Removing a notification

Romeo viewed the last notification he received. His client now removes it (as defined in Publish-Subscribe [2]):

Example 3. Removing a notification

<iq type='set'
    from='romeo@montague.lit/mobile'
    id='retract1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <retract node='urn:xmpp:notify'>
      <item id='9844f81e1408f6ecb932137d33bed7cfdcf518a3'/>
    </retract>
  </pubsub>
</iq>
    

3.5 Emptying notifications

Romeo wants to clear all the pending notifications. His client purges the "urn:xmpp:inbox" PEP node (as defined in Publish-Subscribe [3]):

Example 4. Emptying notifications

<iq type='set'
    from='romeo@montague.lit/mobile'
    id='purge1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
    <purge node='urn:xmpp:notify'/>
  </pubsub>
</iq>
    

4. Security Considerations

The client SHOULD check that the author informations (provided in the "author" element) are valid, by checking that the "publisher" item attribute value matches the "uri" element value. If there is a difference, the notification MIGHT NOT be displayed, and the client SHOULD remove it (see the Removing a notification section of this document).

5. XML Schema

This specification re-uses the schema for the Atom content format, i.e., the 'http://www.w3.org/2005/Atom' namespace (see RFC 4287).

6. Acknowledgements

Thanks to Laurent Eschenauer for his initial idea.


Appendices


Appendix A: Document Information

Series: XEP
Number: 0298
Publisher: XMPP Standards Foundation
Status: Experimental
Type: Standards Track
Version: 0.1
Last Updated: 2011-05-06
Approving Body: XMPP Council
Dependencies: XMPP Core
Supersedes: None
Superseded By: None
Short Name: inbox
Schema: <>
Source Control: HTML  RSS
This document in other formats: XML  PDF


Appendix B: Author Information

Valérian Saliou

Email: vanaryon@gmail.com
JabberID: vanaryon@jappix.com
URI: http://vanaryon.eu/


Appendix C: Legal Notices

Copyright

This XMPP Extension Protocol is copyright © 1999 - 2011 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 <http://xmpp.org/extensions/ipr-policy.shtml> or obtained by writing to XMPP Standards Foundation, 1899 Wynkoop Street, Suite 600, Denver, CO 80202 USA).

Appendix D: Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) 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 <http://xmpp.org/about/discuss.shtml> 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-0115: Entity Capabilities <http://xmpp.org/extensions/xep-0115.html>.

2. XEP-0060: Publish-Subscribe <http://xmpp.org/extensions/xep-0060.html>.

3. XEP-0060: Publish-Subscribe <http://xmpp.org/extensions/xep-0060.html>.


Appendix H: Revision History

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

Version 0.1 (2011-05-06)

First draft.

(vs)

END