You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-30 02:21:17 +03:00
Pillify permalinks to rooms and users (#10388)
This commit is contained in:
@ -473,15 +473,21 @@ export type MessageEventProps = MakeEventPassThruProps & {
|
||||
* @param {number} opts.ts The timestamp for the event.
|
||||
* @param {boolean} opts.event True to make a MatrixEvent.
|
||||
* @param {string=} opts.msg Optional. The content.body for the event.
|
||||
* @param {string=} opts.format Optional. The content.format for the event.
|
||||
* @param {string=} opts.formattedMsg Optional. The content.formatted_body for the event.
|
||||
* @return {Object|MatrixEvent} The event
|
||||
*/
|
||||
export function mkMessage({
|
||||
msg,
|
||||
format,
|
||||
formattedMsg,
|
||||
relatesTo,
|
||||
...opts
|
||||
}: MakeEventPassThruProps & {
|
||||
room: Room["roomId"];
|
||||
msg?: string;
|
||||
format?: string;
|
||||
formattedMsg?: string;
|
||||
}): MatrixEvent {
|
||||
if (!opts.room || !opts.user) {
|
||||
throw new Error("Missing .room or .user from options");
|
||||
@ -493,6 +499,7 @@ export function mkMessage({
|
||||
content: {
|
||||
msgtype: "m.text",
|
||||
body: message,
|
||||
...(format && formattedMsg ? { format, formatted_body: formattedMsg } : {}),
|
||||
["m.relates_to"]: relatesTo,
|
||||
},
|
||||
};
|
||||
|
Reference in New Issue
Block a user