Don't form continuations from thread roots (#8166)

* Don't form continuations from thread roots

* Only apply the continuation break in the main timeline
This commit is contained in:
Robin 2022-03-26 18:06:25 -04:00 committed by GitHub
parent 6c69f3e3b6
commit 1e060fed84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 62 additions and 11 deletions

View file

@ -191,7 +191,20 @@ export function mkEvent(opts: MakeEventProps): MatrixEvent {
].indexOf(opts.type) !== -1) {
event.state_key = "";
}
return opts.event ? new MatrixEvent(event) : event as unknown as MatrixEvent;
const mxEvent = opts.event ? new MatrixEvent(event) : event as unknown as MatrixEvent;
if (!mxEvent.sender && opts.user && opts.room) {
mxEvent.sender = {
userId: opts.user,
membership: "join",
name: opts.user,
rawDisplayName: opts.user,
roomId: opts.room,
getAvatarUrl: () => {},
getMxcAvatarUrl: () => {},
} as unknown as RoomMember;
}
return mxEvent;
}
/**