From b219c4bb7ab5b3fac8e45caac72b1ab318ccdea7 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Thu, 25 Aug 2022 13:53:43 +0200 Subject: [PATCH] fun: Update XEP --- xep-xxxx-file-upload-notification.md | 57 ++++++++++++---------------- 1 file changed, 24 insertions(+), 33 deletions(-) diff --git a/xep-xxxx-file-upload-notification.md b/xep-xxxx-file-upload-notification.md index 77f87d7..bb3700a 100644 --- a/xep-xxxx-file-upload-notification.md +++ b/xep-xxxx-file-upload-notification.md @@ -13,20 +13,19 @@ that will be replaced once the file has been uploaded. ```xml - - - vacation.jpg - image/jpeg - - - LEHV6nWB2yk8pyoJadR*.7kCMdnj - - - - - - - + + + vacation.jpg + image/jpeg + + LEHV6nWB2yk8pyoJadR*.7kCMdnj + + + + + + + ``` @@ -37,9 +36,6 @@ The metadata should include only the bare minimum, i.e. the mime type and filena Additionally, zero or more thumbnails can be sent with the notification in order to allow clients to already show a preview. The `` element is specified by [File Thumbnails](https://github.com/PapaTutuWawa/custom-xeps/blob/master/xep-xxxx-file-thumbnails.md). -Note that [Unique and Stable Origin IDs](https://xmpp.org/extensions/xep-0359.html) must be used when the message is sent to a -groupchat. - Since this message carries no meaning to anyone retrieving it after the file upload has been completed, a `` element should be added (See [Message Processing Hints](https://xmpp.org/extensions/xep-0334.html)). @@ -54,17 +50,14 @@ in the message to inform clients which messages should be replaced. ... - - + ``` -The `id` attribute of the `` element refers to either the stanza ID or the -origin ID of the message that contained the original ``. +The `id` attribute of the `` element refers to either the stanza ID of the +message that contained the original ``. -If sent to a groupchat, the origin ID must be used. - -Note the the actual method of communicating a file is of no relevance here, as long as the +Note that the actual method of communicating a file is of no relevance here, as long as the method allows a client to show it inline. Examples for such methods are [Out of Band Data](https://xmpp.org/extensions/xep-0066.html) and [Stateless Inline Media Sharing](https://xmpp.org/extensions/xep-0385.html). @@ -80,26 +73,24 @@ If the uploading entity has cancelled the upload, then it should indicate so to ```xml - - - + ``` In this example, the uploading entity just sends a message containing a `` tag to indicate the -cancellation, allowing receiving clients to perhaps stop showing loading spinners and the like. The -`` is used to indicate what original message this cancellation applies to. +cancellation, allowing receiving clients to perhaps stop showing loading spinners and the +like. Its `id` attribute refers to the message containing the original `` +element. ## Security Considerations -A client receiveing a message with an `` element must verify if the message it -is supposed to replace was actually sent by the sender of the `` element to -prevent arbitrary messages to be replaced. +- A client receiving a File Upload Notification must ensure that only messages containing a `` are replaced. This is to ensure arbitrary messages being replaced by file uploads. +- A client receiving a File Upload Notification MUST ensure that replacements and cancellations are only accepted from the JID that sent the original message containing the `` element. This means that as long as the two JIDs are equal when bare, then the replacement or cancellation is valid. ## Info | Key | Value | | --- | --- | | Author | PapaTutuWawa | -| Version | 0.0.4 | +| Version | 0.0.5 | | Short name | fun |