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:
parent
6be09eec09
commit
b5727cb463
11 changed files with 717 additions and 189 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue