More fixes for servers without m.thread-support

Also, always retry loading timeline without "initialEventId" if first attempt fails (previously we did it only for M_UNKNOWN errors)
This commit is contained in:
N-Pex 2024-06-28 11:49:55 +02:00
parent ecb4b1717b
commit 8f227c2994
6 changed files with 20 additions and 14 deletions

View file

@ -68,6 +68,11 @@ class UploadPromise {
}
class Util {
threadMessageType() {
return Thread.hasServerSideSupport ? "m.thread" : "io.element.thread"
}
getAttachmentUrlAndDuration(event) {
return new Promise((resolve, reject) => {
const content = event.getContent();
@ -400,7 +405,7 @@ class Util {
// If thread root (an eventId) is set, add that here
if (threadRoot) {
messageContent["m.relates_to"] = {
"rel_type": Thread.hasServerSideSupport ? "m.thread" : "io.element.thread",
"rel_type": this.threadMessageType(),
"event_id": threadRoot
};
}