Update File Upload Notifications
This commit is contained in:
parent
6d9e295741
commit
3ccf702476
@ -13,13 +13,13 @@ 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="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="blurhash" xmlns="urn:xmpp:thumbnail:0">
|
<thumbnail type="proto:urn:xmpp:file-thumbnails:0:blurhash" xmlns="proto:urn:xmpp:file-thumbnails:0">
|
||||||
<payload>LEHV6nWB2yk8pyoJadR*.7kCMdnj</payload>
|
<blurhash>LEHV6nWB2yk8pyoJadR*.7kCMdnj</blurhash>
|
||||||
</thumbnail>
|
</thumbnail>
|
||||||
</file-upload>
|
</file-upload>
|
||||||
<origin-id xmlns="urn:xmpp:sid:0" id="ccccc" />
|
<origin-id xmlns="urn:xmpp:sid:0" id="ccccc" />
|
||||||
@ -32,7 +32,7 @@ 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, a thumbnail can be sent with the notification in order to allow clients
|
||||||
to already show a preview. The `<thumbnail />` element is specified by [Thumbnails](https://github.com/PapaTutuWawa/custom-xeps/blob/master/xep-xxxx-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
|
||||||
groupchat.
|
groupchat.
|
||||||
@ -51,7 +51,7 @@ in the message to inform clients which messages should be replaced.
|
|||||||
<x xmlns="jabber:x:oob">
|
<x xmlns="jabber:x:oob">
|
||||||
<url>...</url>
|
<url>...</url>
|
||||||
</x>
|
</x>
|
||||||
<replaces xmlns="urn:xmpp:fun:0" id="ccccc" />
|
<replaces xmlns="proto:urn:xmpp:fun:0" id="ccccc" />
|
||||||
<origin-id xmlns="urn:xmpp:sid:0" id="ddddd" />
|
<origin-id xmlns="urn:xmpp:sid:0" id="ddddd" />
|
||||||
</message>
|
</message>
|
||||||
```
|
```
|
||||||
@ -66,8 +66,21 @@ method allows a client to show it inline. Examples for such methods are
|
|||||||
[Out of Band Data](https://xmpp.org/extensions/xep-0066.html)
|
[Out of Band Data](https://xmpp.org/extensions/xep-0066.html)
|
||||||
and [Stateless Inline Media Sharing](https://xmpp.org/extensions/xep-0385.html).
|
and [Stateless Inline Media Sharing](https://xmpp.org/extensions/xep-0385.html).
|
||||||
|
|
||||||
|
In case the sender uses methods like [Stateless Inline Media Sharing](https://xmpp.org/extensions/xep-0385.html)
|
||||||
|
or [Stateless File Sharing](https://xmpp.org/extensions/xep-0447.html) which allow specifying
|
||||||
|
a thumbnail, then the client should do here as well to allow clients catching up using
|
||||||
|
[Message Archive Management](https://xmpp.org/extensions/xep-0313.html) to also provide a thumbnail to their users.
|
||||||
|
|
||||||
## Security Considerations
|
## Security Considerations
|
||||||
|
|
||||||
A client receiveing a message with an `<replaces />` element must verify if the message it
|
A client receiveing a message with an `<replaces />` element must verify if the message it
|
||||||
is supposed to replace was actually sent by the sender of the `<replaces />` element to
|
is supposed to replace was actually sent by the sender of the `<replaces />` element to
|
||||||
prevent arbitrary messages to be replaced.
|
prevent arbitrary messages to be replaced.
|
||||||
|
|
||||||
|
## Info
|
||||||
|
|
||||||
|
| Key | Value |
|
||||||
|
| --- | --- |
|
||||||
|
| Author | PapaTutuWawa |
|
||||||
|
| Version | 0.0.2 |
|
||||||
|
| Short name | fun |
|
||||||
|
Loading…
Reference in New Issue
Block a user