-
Notifications
You must be signed in to change notification settings - Fork 385
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
MSC2765: Widget avatars #2765
MSC2765: Widget avatars #2765
Changes from 3 commits
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,51 @@ | ||
# MSC2765: Widget avatars | ||
|
||
Currently widgets have a name and title associated with them, though no opportunity for avatars | ||
for a favicon-like experience. This proposal introduces such a concept. | ||
|
||
## Proposal | ||
|
||
A new optional paramater named `avatar_url` is added to the widget definition. This parameter is | ||
an MXC URI to an image clients can use to associate with the widget, likely alongside the `name` | ||
and/or `title`. | ||
|
||
Widget avatars SHOULD be legible at small sizes, such as 20x20. The MXC URI in the `avatar_url` | ||
should be the source material to allow clients to use the `/thumbnail` API to get a size for their | ||
use case. | ||
|
||
Rendering avatars is optional for clients, much like how clients are not required to use the `name` | ||
or `title` of a widget. | ||
|
||
An example widget would be: | ||
|
||
```json | ||
{ | ||
"creatorUserId": "@alice:example.org", | ||
"data": { | ||
"custom-key": "This is a custom key", | ||
turt2live marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"title": "This is a witty description for the widget" | ||
}, | ||
"id": "20200827_WidgetExample", | ||
"name": "My Cool Widget", | ||
"type": "m.custom", | ||
"url": "https://example.org/my/widget.html?roomId=$matrix_room_id", | ||
"waitForIframeLoad": true, | ||
"avatar_url": "mxc://example.org/abc123" | ||
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. Wait, why is this using underscores when the other properties are using camel case? 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.
Thought it was located somewhere else. Ideally we'd fix this over time to be all underscored 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. fair enough I guess. |
||
} | ||
``` | ||
|
||
## Alternatives | ||
|
||
We could define a whole structured system for different thumbnail sizes, though we have a thumbnail | ||
API which can be used to request whatever size is needed by the client. | ||
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. One consideration is that you can significantly improve the quality of icons by having specific bitmaps for each size, so that extra detail can be included in larger icons but smaller ones can be simple. We don't necessarily need to do this now but since you've said above that 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. yea, this is definitely something for a future MSC. I'd like to solve the general case of client-supplied thumbnails at the same time, possibly for user/room avatars too. Something like "when you display my avatar as 500x500, use this one". Abuse/lying about different avatars would be an interesting problem to solve though. |
||
|
||
## Security considerations | ||
|
||
Widget avatars could be non-images. Clients should use the thumbnail API to encourage error responses | ||
from the server when a widget avatar is a non-image. | ||
|
||
## Unstable prefix | ||
|
||
While this MSC is not in a released version of the specification, clients should use an alternative | ||
event type for widgets or use `org.matrix.msc2765.avatar_url` when using `m.widget` or `m.widgets` | ||
as an event type. |
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.
Widgets aren't in the spec at all yet, a ctrl+f on the unstable c-s api for "widget" or "m.custom" yields nothing. If you are building on an existing MSC, please link it
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.
It's specifically not linked due to pending spec pr: #2764
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.
Ah great, thank you