-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sticker messages (m.sticker) #1158
Changes from 5 commits
a87cd82
2989406
91f1834
c471f48
0f8e34d
f421337
c59b879
250ada7
a1fdecc
8dd7bd5
1d9de28
43d9543
90d9960
eb7bbcf
618096e
114e9e2
761ad98
56dc295
02c5afb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"age": 242352, | ||
"content": { | ||
"body": "Landing", | ||
"info": { | ||
"mimetype": "image/png", | ||
"thumbnail_info": { | ||
"mimetype": "image/png", | ||
"h": 200, | ||
"w": 140, | ||
"size": 73602 | ||
}, | ||
"h": 200, | ||
"thumbnail_url": "mxc://matrix.org/sHhqkFCvSkFwtmvtETOtKnLP", | ||
"w": 140, | ||
"size": 73602 | ||
}, | ||
"url": "mxc://matrix.org/sHhqkFCvSkFwtmvtETOtKnLP" | ||
}, | ||
"origin_server_ts": 1431961217939, | ||
"event_id": "$WLGTSEFSEF:localhost", | ||
"type": "m.sticker", | ||
"room_id": "!Cuyf34gef24t:localhost", | ||
"sender": "@example:localhost" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
allOf: | ||
- $ref: core-event-schema/room_event.yaml | ||
description: This message represents a single sticker image. | ||
properties: | ||
content: | ||
properties: | ||
body: | ||
description: "A textual representation or associated description of the sticker image. This could be the alt text of the original image, or a message to accompany and further describe the sticker." | ||
type: string | ||
info: | ||
allOf: | ||
- $ref: core-event-schema/msgtype_infos/image_info.yaml | ||
description: Metadata about the image referred to in ``url`` including a thumbnail representation. | ||
url: | ||
description: The URL to the sticker image. | ||
type: string | ||
required: | ||
- body | ||
- info | ||
- url | ||
type: object | ||
type: | ||
enum: | ||
- m.sticker | ||
type: string | ||
title: StickerMessage | ||
type: object |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
.. Copyright 2018 New Vector Ltd. | ||
.. | ||
.. Licensed under the Apache License, Version 2.0 (the "License"); | ||
.. you may not use this file except in compliance with the License. | ||
.. You may obtain a copy of the License at | ||
.. | ||
.. http://www.apache.org/licenses/LICENSE-2.0 | ||
.. | ||
.. Unless required by applicable law or agreed to in writing, software | ||
.. distributed under the License is distributed on an "AS IS" BASIS, | ||
.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
.. See the License for the specific language governing permissions and | ||
.. limitations under the License. | ||
|
||
Sticker Messages | ||
================ | ||
|
||
.. _module:stickers: | ||
|
||
This module allows users to send sticker messages in to rooms or direct messaging sessions. | ||
|
||
Sticker messages are specialised image messages that are displayed without controls (e.g. no "download" link, or light-box view on click, as would be displayed for for m.room.message#m.image events). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. might be nice to link to the m.image definition. I think something as simple as `m.image`_ might work. |
||
|
||
Sticker messages are intended to provide simple "reaction" events in the message timeline. The matrix client should provide some mechanism to display the sticker "body" e.g. as a tooltip on hover, or in a modal when the sticker image is clicked. | ||
|
||
Events | ||
------ | ||
Sticker events are received as single ``m.sticker`` event in the | ||
``timeline`` section of a room in a ``/sync``. | ||
|
||
{{m_sticker_event}} | ||
|
||
Client behaviour | ||
---------------- | ||
|
||
Clients supporting this message type should display the image content from the event URL directly in the timeline. | ||
|
||
A thumbnail image should be provided in the message info. object. This is largely intended as a fallback for clients that do not fully support the m.sticker event type. Im most cases it is fine to set the thumbnail URL to the same URL as the main event content. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think just ``info`` (rather than 'message info.') here. double-backticks around m.sticker. s/Im/In/ |
||
|
||
It is recommended that sticker image content should be approximately 400x400 pixels in size (or smaller). The image dimensions specified in the info. object of the message should be half of the original image dimensions in order to display correctly on retina displays. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. info as above There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm failing to grok the idea behind the retina display thing tbh There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is intended as a way of ensuring that the images are displayed as crisply as possible on high resolution displays. If the physical image is double the size of the event dimensions metadata it will be scaled down on normal resolution screens (by displaying every second pixel). On 2x (retina screens) the full resolution of the image will be used, resulting in a crisper image on displays that support it. - This was @ara4n's suggestion originally, as a short-term solution. However in the longer term we probably need to improve this by getting the media server to be able to render content for different DPI devices, or by specifying alternate display content in the sticker metadata. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just for compatibility with telegram, can we bump the recommendation to 512x512? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure. Updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please could you wrap at 80 cols as per https://github.com/matrix-org/matrix-doc/blob/master/meta/documentation_style.rst#line-widths?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, sorry for missing that. Now wrapped.