You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-07 05:22:15 +03:00
Make threads reply chain filter out local event ID (#2129)
This commit is contained in:
@@ -138,10 +138,13 @@ export class Thread extends TypedEventEmitter<ThreadEvent> {
|
|||||||
/**
|
/**
|
||||||
* Return last reply to the thread
|
* Return last reply to the thread
|
||||||
*/
|
*/
|
||||||
public get lastReply(): MatrixEvent {
|
public lastReply(matches: (ev: MatrixEvent) => boolean = () => true): MatrixEvent {
|
||||||
const threadReplies = this.events
|
for (let i = this.events.length - 1; i >= 0; i--) {
|
||||||
.filter(event => event.isThreadRelation);
|
const event = this.events[i];
|
||||||
return threadReplies[threadReplies.length - 1];
|
if (event.isThreadRelation && matches(event)) {
|
||||||
|
return event;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user