-
-
Notifications
You must be signed in to change notification settings - Fork 648
Add support for HTML renderings of room topics #2272
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
6bf4370
Add support for HTML renderings of room topics
e2306f8
Use correct MSC
Johennes d66901c
Merge branch 'develop' into feature/html-topic
Johennes 89a3247
Merge branch 'develop' into feature/html-topic
Johennes a0814ae
Add overloads for setRoomTopic
Johennes 4cbf1be
Merge branch 'develop' into feature/html-topic
Johennes ec8c080
Fix indentation
Johennes dac3058
Merge branch 'develop' into feature/html-topic
Johennes 98dc106
Merge branch 'develop' into feature/html-topic
Johennes f7e526a
Merge branch 'develop' into feature/html-topic
Johennes 105083a
Merge branch 'develop' into feature/html-topic
Johennes 68b0d5e
Merge branch 'develop' into feature/html-topic
Johennes 5013c5b
Add more tests to pass the quality gate
Johennes b946781
Merge branch 'develop' into feature/html-topic
Johennes 85fd1f4
Merge branch 'develop' into feature/html-topic
t3chguy 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 hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| /* | ||
| Copyright 2022 The Matrix.org Foundation C.I.C. | ||
|
|
||
| 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. | ||
| */ | ||
|
|
||
| import { EitherAnd, IMessageRendering } from "matrix-events-sdk"; | ||
|
|
||
| import { UnstableValue } from "../NamespacedValue"; | ||
|
|
||
| /** | ||
| * Extensible topic event type based on MSC3765 | ||
| * https://github.com/matrix-org/matrix-spec-proposals/pull/3765 | ||
| */ | ||
|
|
||
| /** | ||
| * Eg | ||
| * { | ||
| * "type": "m.room.topic, | ||
| * "state_key": "", | ||
| * "content": { | ||
| * "topic": "All about **pizza**", | ||
| * "m.topic": [{ | ||
| * "body": "All about **pizza**", | ||
| * "mimetype": "text/plain", | ||
| * }, { | ||
| * "body": "All about <b>pizza</b>", | ||
| * "mimetype": "text/html", | ||
| * }], | ||
| * } | ||
| * } | ||
| */ | ||
|
|
||
| /** | ||
| * The event type for an m.topic event (in content) | ||
| */ | ||
| export const M_TOPIC = new UnstableValue("m.topic", "org.matrix.msc3765.topic"); | ||
|
|
||
| /** | ||
| * The event content for an m.topic event (in content) | ||
| */ | ||
| export type MTopicContent = IMessageRendering[]; | ||
|
|
||
| /** | ||
| * The event definition for an m.topic event (in content) | ||
| */ | ||
| export type MTopicEvent = EitherAnd<{ [M_TOPIC.name]: MTopicContent }, { [M_TOPIC.altName]: MTopicContent }>; | ||
|
|
||
| /** | ||
| * The event content for an m.room.topic event | ||
| */ | ||
| export type MRoomTopicEventContent = { topic: string } & MTopicEvent; |
This file contains hidden or 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
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.