Update: File Upload Notification

This commit is contained in:
PapaTutuWawa 2022-03-02 17:06:36 +01:00
parent 606b3aae90
commit 9b5e1a6f65

View File

@ -13,17 +13,20 @@ that will be replaced once the file has been uploaded.
```xml ```xml
<message from="some.user@some.server/abc123" to="someone.else@other.server" id="aaaaa"> <message from="some.user@some.server/abc123" to="someone.else@other.server" id="aaaaa">
<file-upload xmlns="proto:urn:xmpp:fun:0"> <file-upload xmlns="proto:urn:xmpp:fun:0">
<file xmlns="urn:xmpp:file:metadata:0"> <file xmlns="urn:xmpp:file:metadata:0">
<name>vacation.jpg</name> <name>vacation.jpg</name>
<media-type>image/jpeg</media-type> <media-type>image/jpeg</media-type>
</file> </file>
<thumbnail type="proto:urn:xmpp:file-thumbnails:0:blurhash" xmlns="proto:urn:xmpp:file-thumbnails:0"> <thumbnail type="blurhash" xmlns="proto:urn:xmpp:file-thumbnails:0">
<blurhash>LEHV6nWB2yk8pyoJadR*.7kCMdnj</blurhash> <blurhash>LEHV6nWB2yk8pyoJadR*.7kCMdnj</blurhash>
</thumbnail> </thumbnail>
</file-upload> <thumbnail type="base64-bob" xmlns="proto:urn:xmpp:file-thumbnails:0">
<origin-id xmlns="urn:xmpp:sid:0" id="ccccc" /> <base64-bob uri="cid:sha1+...@bob.xmpp.org" media-type="image/png" width="128" height="96" />
<no-permanent-store xmlns="urn:xmpp:hints" /> </thumbnail>
</file-upload>
<origin-id xmlns="urn:xmpp:sid:0" id="ccccc" />
<no-permanent-store xmlns="urn:xmpp:hints" />
</message> </message>
``` ```
@ -31,7 +34,7 @@ The `<file-upload>` element indicates that a message should be replaced with the
file embed once the upload is done. Metadata about the file should be included file embed once the upload is done. Metadata about the file should be included
as specified by [File metadata element](https://xmpp.org/extensions/xep-0446.html). as specified by [File metadata element](https://xmpp.org/extensions/xep-0446.html).
The metadata should include only the bare minimum, i.e. the mime type and filename. The metadata should include only the bare minimum, i.e. the mime type and filename.
Additionally, a thumbnail can be sent with the notification in order to allow clients Additionally, one or more thumbnails can be sent with the notification in order to allow clients
to already show a preview. The `<file-thumbnail />` element is specified by [File Thumbnails](https://github.com/PapaTutuWawa/custom-xeps/blob/master/xep-xxxx-file-thumbnails.md). to already show a preview. The `<file-thumbnail />` 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 Note that [Unique and Stable Origin IDs](https://xmpp.org/extensions/xep-0359.html) must be used when the message is sent to a
@ -82,5 +85,5 @@ prevent arbitrary messages to be replaced.
| Key | Value | | Key | Value |
| --- | --- | | --- | --- |
| Author | PapaTutuWawa | | Author | PapaTutuWawa |
| Version | 0.0.2 | | Version | 0.0.3 |
| Short name | fun | | Short name | fun |