Remove fallback replies & implement intentional mentions (#2138)
* Remove reply fallbacks & add m.mentions (WIP) the typing on line 301 and 303 needs fixing but apart from that this is mint * Less jank typing * Mention the reply author in m.mentions * Improve typing * Fix typing in m.mentions finder * Correctly iterate through editor children, properly handle @room, ... ..., don't mention the reply author when the reply author is ourself, don't add own user IDs when mentioning intentionally * Formatting * Add intentional mentions to edited messages * refactor reusable code and fix todo * parse mentions from all nodes --------- Co-authored-by: Ajay Bura <32841439+ajbura@users.noreply.github.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
EventTimeline,
|
||||
EventTimelineSet,
|
||||
EventType,
|
||||
IMentions,
|
||||
IPushRule,
|
||||
IPushRules,
|
||||
JoinRule,
|
||||
@@ -430,3 +431,15 @@ export const getLatestEditableEvt = (
|
||||
export const reactionOrEditEvent = (mEvent: MatrixEvent) =>
|
||||
mEvent.getRelation()?.rel_type === RelationType.Annotation ||
|
||||
mEvent.getRelation()?.rel_type === RelationType.Replace;
|
||||
|
||||
export const getMentionContent = (userIds: string[], room: boolean): IMentions => {
|
||||
const mMentions: IMentions = {};
|
||||
if (userIds.length > 0) {
|
||||
mMentions.user_ids = userIds;
|
||||
}
|
||||
if (room) {
|
||||
mMentions.room = true;
|
||||
}
|
||||
|
||||
return mMentions;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user