You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-07 21:23:00 +03:00
Include thread replies in message previews (#10631)
* Include thread replies to message previews * Extend tests * Fix type issue * Use currentColor for thread icon * Fix long room name overflow * Update snapshots * Fix preview * Fix typing issue * Fix type issues * Tweak thread reply detection * Extend tests * Fix type issue * Fix test
This commit is contained in:
@@ -36,6 +36,7 @@ import {
|
||||
ConditionKind,
|
||||
PushRuleActionName,
|
||||
IPushRules,
|
||||
RelationType,
|
||||
} from "matrix-js-sdk/src/matrix";
|
||||
import { normalize } from "matrix-js-sdk/src/utils";
|
||||
import { ReEmitter } from "matrix-js-sdk/src/ReEmitter";
|
||||
@@ -471,6 +472,29 @@ export type MessageEventProps = MakeEventPassThruProps & {
|
||||
msg?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a "🙃" reaction for the given event.
|
||||
* Uses the same room and user as for the event.
|
||||
*
|
||||
* @returns The reaction event
|
||||
*/
|
||||
export const mkReaction = (event: MatrixEvent, opts: Partial<MakeEventProps> = {}): MatrixEvent => {
|
||||
return mkEvent({
|
||||
event: true,
|
||||
room: event.getRoomId(),
|
||||
type: EventType.Reaction,
|
||||
user: event.getSender()!,
|
||||
content: {
|
||||
"m.relates_to": {
|
||||
rel_type: RelationType.Annotation,
|
||||
event_id: event.getId(),
|
||||
key: "🙃",
|
||||
},
|
||||
},
|
||||
...opts,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Create an m.room.message event.
|
||||
* @param {Object} opts Values for the message
|
||||
|
Reference in New Issue
Block a user