From 1f734cd4a90682d56b0c48f31b29b04c12baaa8a Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 3 Sep 2020 08:53:10 -0600 Subject: [PATCH 1/4] Proposal to support widget avatars --- proposals/0000-widget-avatars.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 proposals/0000-widget-avatars.md diff --git a/proposals/0000-widget-avatars.md b/proposals/0000-widget-avatars.md new file mode 100644 index 00000000..45433c6e --- /dev/null +++ b/proposals/0000-widget-avatars.md @@ -0,0 +1,32 @@ +# MSC0000: 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 + +In the widget's `data`, a new optional paramater named `avatar_url` is added. 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. + +## 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. + +## 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 + +Not applicable - this is backwards compatible with specification and an allowed property of `data` +without this MSC. From d8bc158a3ba7b7a78369b843a05896520c78844e Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 3 Sep 2020 08:55:27 -0600 Subject: [PATCH 2/4] Renumber --- proposals/{0000-widget-avatars.md => 2765-widget-avatars.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename proposals/{0000-widget-avatars.md => 2765-widget-avatars.md} (97%) diff --git a/proposals/0000-widget-avatars.md b/proposals/2765-widget-avatars.md similarity index 97% rename from proposals/0000-widget-avatars.md rename to proposals/2765-widget-avatars.md index 45433c6e..1849fae4 100644 --- a/proposals/0000-widget-avatars.md +++ b/proposals/2765-widget-avatars.md @@ -1,4 +1,4 @@ -# MSC0000: Widget avatars +# 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. From 70e69a110a5471417e0ce961f0afb8ef9b9d9e9b Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 3 Sep 2020 09:00:36 -0600 Subject: [PATCH 3/4] Move the avatar up a level --- proposals/2765-widget-avatars.md | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/proposals/2765-widget-avatars.md b/proposals/2765-widget-avatars.md index 1849fae4..14facbb2 100644 --- a/proposals/2765-widget-avatars.md +++ b/proposals/2765-widget-avatars.md @@ -5,7 +5,7 @@ for a favicon-like experience. This proposal introduces such a concept. ## Proposal -In the widget's `data`, a new optional paramater named `avatar_url` is added. This parameter is +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`. @@ -16,6 +16,24 @@ 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", + "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" +} +``` + ## Alternatives We could define a whole structured system for different thumbnail sizes, though we have a thumbnail @@ -28,5 +46,6 @@ from the server when a widget avatar is a non-image. ## Unstable prefix -Not applicable - this is backwards compatible with specification and an allowed property of `data` -without this MSC. +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. From ee55d9d35bbb107a6ea8b2edea3e2f8574e94c8e Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 22 Oct 2020 11:23:32 -0600 Subject: [PATCH 4/4] Update proposals/2765-widget-avatars.md Co-authored-by: Hubert Chathi --- proposals/2765-widget-avatars.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/2765-widget-avatars.md b/proposals/2765-widget-avatars.md index 14facbb2..a9030d29 100644 --- a/proposals/2765-widget-avatars.md +++ b/proposals/2765-widget-avatars.md @@ -22,7 +22,7 @@ An example widget would be: { "creatorUserId": "@alice:example.org", "data": { - "custom-key": "This is a custom key", + "custom_key": "This is a custom key", "title": "This is a witty description for the widget" }, "id": "20200827_WidgetExample",