This repository has been archived by the owner on May 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Quick proposal for native widgets #313
Open
BillCarsonFr
wants to merge
1
commit into
master
Choose a base branch
from
proposal_native_widgets
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,6 +121,9 @@ below. The widget's event ID is the object's key, with the value being whether o | |
is allowed to load. If a widget is not in this event, it should be assumed as *not* allowed to | ||
load (ie: `false`). | ||
|
||
For the case of `native widgets` i.e widgets that are not loaded as a webview/iframe, the client will not directly open the widget event `content.url`, thus permission between a native widget and a regular widget might not be shared. | ||
For that case permission then can be stored and shared in a separate map. | ||
|
||
Account/user widgets do not need to use this prompt. | ||
|
||
**Event type**: `im.vector.setting.allowed_widgets` | ||
|
@@ -132,6 +135,11 @@ Account/user widgets do not need to use this prompt. | |
{ | ||
"widgets": { | ||
"<event ID of widget>": true | ||
}, | ||
"native_widgets": { | ||
"<native widget type>": { | ||
"<event ID of widget or Domain>": true | ||
} | ||
} | ||
} | ||
``` | ||
|
@@ -174,3 +182,45 @@ would result in the following room account data `content`: | |
} | ||
} | ||
``` | ||
|
||
|
||
|
||
A Jitsi widget which looks like | ||
|
||
```json | ||
{ | ||
"content": { | ||
"data": { | ||
"widgetSessionId": "f8dwx54bzjv" | ||
}, | ||
"name": "Jitsi", | ||
"type": "jitsi", | ||
"url": "https://scalar-staging.vector.im/api/widgets/jitsi.html?confId=ybTPiERTEDGFeUexampleorgf8dwx54bzjv&isAudioConf=false&displayName=alice&avatarUrl=xxx&email=xxx", | ||
"id": "jitsi_%40alice%3Aexample.org_1573840888190", | ||
"waitForIframeLoad": true, | ||
"creatorUserId": "@alice:example.org" | ||
}, | ||
"event_id": "$157384089555352RPrqe:example.org", | ||
"origin_server_ts": 1573840895733, | ||
"sender": "@alice:example.org", | ||
"state_key": "jitsi_%40alice%3Aexample.org_1573840888190", | ||
"type": "im.vector.modular.widgets", | ||
"room_id": "!somewhere:example.org" | ||
} | ||
``` | ||
|
||
Would result in the following room account data `content` for a client that is loading it using a Jitsi Native SDK (in this case consent is saved for the jitsi domain instead of per state event id): | ||
```json | ||
{ | ||
"widgets": { | ||
... | ||
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. maybe add a real sample of data? |
||
}, | ||
"native_widgets": { | ||
"jitsi" : { | ||
"jitsi.riot.im": true | ||
} | ||
} | ||
} | ||
``` | ||
|
||
Giving consent for the Native implementation, does not give consent for the webview/iframe version. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is it room account data or user account data?