The specification of Chat State Notifications (XEP-0085)  defines a protocol for exchanging information about the activity of the user, for example that the user is currently typing. However with the new possibilities of media sharing as in Stateless Inline Media Sharing (XEP-0385)  and HTTP File Upload (XEP-0363)  there are also new desirable chat states. For example when a user uploads an image, the upload usually takes a while. To notify the chat partner about the uploading process a new chat state is required.
When users send large files or have a very slow upstream connection it can make the chat partner confused when they are receiving an uploading state for a long time. In these cases it can be nice to share the upload progress. This way the chat partner can estimate if a file will arrive immediately or if it is better to go and get a coffee first.
Apart from notifications for sending files, there should also be notifications when a user is creating new media files, for example when the user is recording audio, recording a video or is taking a picture.
Bernardo is informing Francisco about his activity of taking a picture to send it afterwards. If Francisco's client supports file sharing notifications, it should display this similarly to 'Bernardo is taking a photo…'.
A list of possible 'type' attributes is defined below.
|animation||An animated image file, for example a GIF file. It SHOULD NOT be used in the <creating/> state.|
|audio||An audio file. This MAY also be displayed as a voice recording when used in the <creating/> state.|
|image||An image file.|
|video||A video file.|
Bernardo has taken a good picture for sending and has started uploading, now. The same notification is also used when the image existed before and there were no process of creating it.
The client SHOULD include a 'progress' attribute. It MUST be in the range of zero (0) and one (1). This value represents the bytes already sent divided by the total bytes. Generally it is not necessary to include more than two digits after the decimal point since the exact uploading status is not important. Clients MUST NOT send progress updates more often than once per second.
The 'type' attribute equals the 'type' attribute by the <creating/> element.
The file upload has succeeded. Now Bernardo can send the file sharing message as in Stateless Inline Media Sharing (XEP-0385)  or another file sharing protocol. Francisco's client MUST clear the previous <uploading> notification. The <upload-finished/> notification itself SHOULD NOT be displayed to the user.
Of course the file upload also could have ended otherwise. In this case Bernardo has manually aborted the file upload. If the client encounters problems with the upload service after sending the first file sharing notification, the same format will also be used.
A client MAY choose not to apply this mapping if it allows text input while creating or uploading media, to allow transmitting normal XEP-0085 states for the text input.
If a client allows a user to pick media which are already created (thus skipping the <creating/> state), it MAY treat interaction with the media selection like text input in XEP-0085 (i.e. send <composing/> while the user is actively engaging with it and switch to <paused/> if inactive for a certain time).
Media sharing protocols as Stateless Inline Media Sharing (XEP-0385)  don't forbid concurrent file uploads, so it may be the case that a client is uploading multiple files of different types to the same user or groupchat at the same time. This could result in different file types being affected at the same time. In this case clients SHOULD follow these rules:
It is possible that the connection to any client is lost at any time or a client crashes. Thus, a client SHOULD work with timeouts that will clear notifications after certain intervals.
A client MUST have a possibility to disable file sharing notifications. This setting MAY be the same as the one for enabling Chat State Notifications (XEP-0085) .
This document requires no interaction with the Internet Assigned Numbers Authority (IANA).
This specification defines the following XML namespace:
Upon advancement of this specification from a status of Experimental to a status of Draft, the XMPP Registrar  shall add the foregoing namespace to the registry located at <https://xmpp.org/registrar/namespaces.html>, as described in Section 4 of XMPP Registrar Function (XEP-0053) .
Thanks to Jonas Wielicki for his helpful feedback and input.
This document in other formats: XML PDF
This XMPP Extension Protocol is copyright © 1999 – 2020 by the XMPP Standards Foundation (XSF).
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.
## 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. ##
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.
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).
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.
The primary venue for discussion of XMPP Extension Protocols is the <email@example.com> 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 <firstname.lastname@example.org>.
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".
7. 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/>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
Add upload-finished state, minor improvements.
Added Requirements and Acknowledgements, simplified some definitions and added rules for CSI.
Seperated parts about the usage of chat states and moved the definitions of types to their examples.