Implement MSC3952: intentional mentions (#9983)
Implements the intentional mentions feature of MSC3952 (behind a labs flag). If enabled, this will send an org.matrix.msc3952.mentions property on events that will contain the user IDs and/or whether the room is being mentioned. These mentions also gets propagated via some custom behaviour for replies and edits.
This commit is contained in:
parent
5a1a91f16a
commit
e19127f8ad
11 changed files with 431 additions and 23 deletions
|
@ -39,7 +39,7 @@ import InlineSpinner from "../elements/InlineSpinner";
|
|||
import { PlaybackManager } from "../../../audio/PlaybackManager";
|
||||
import { doMaybeLocalRoomAction } from "../../../utils/local-room";
|
||||
import defaultDispatcher from "../../../dispatcher/dispatcher";
|
||||
import { attachRelation } from "./SendMessageComposer";
|
||||
import { attachMentions, attachRelation } from "./SendMessageComposer";
|
||||
import { addReplyToMessageContent } from "../../../utils/Reply";
|
||||
import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks";
|
||||
import RoomContext from "../../../contexts/RoomContext";
|
||||
|
@ -129,6 +129,8 @@ export default class VoiceRecordComposerTile extends React.PureComponent<IProps,
|
|||
this.state.recorder.getPlayback().thumbnailWaveform.map((v) => Math.round(v * 1024)),
|
||||
);
|
||||
|
||||
// Attach mentions, which really only applies if there's a replyToEvent.
|
||||
attachMentions(MatrixClientPeg.get().getSafeUserId(), content, null, replyToEvent);
|
||||
attachRelation(content, relation);
|
||||
if (replyToEvent) {
|
||||
addReplyToMessageContent(content, replyToEvent, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue