Lots of fixes to "media threads"

This commit is contained in:
N Pex 2023-11-06 15:28:26 +00:00
parent fe081edc62
commit 8bcceafcff
23 changed files with 867 additions and 333 deletions

View file

@ -299,10 +299,8 @@ class Util {
if (err && err.name == "UnknownDeviceError") {
console.log("Unknown devices. Mark as known before retrying.");
var setAsKnownPromises = [];
for (var user of Object.keys(err.devices)) {
const userDevices = err.devices[user];
for (var deviceId of Object.keys(userDevices)) {
const deviceInfo = userDevices[deviceId];
err.devices.forEach((userDevices, user) => {
userDevices.forEach((deviceInfo, deviceId) => {
if (!deviceInfo.known) {
setAsKnownPromises.push(
matrixClient.setDeviceKnown(
@ -312,9 +310,9 @@ class Util {
)
);
}
}
}
Promise.all(setAsKnownPromises)
});
});
return Promise.all(setAsKnownPromises)
.then(() => {
// All devices now marked as "known", try to resend
let event = err.event;
@ -499,7 +497,6 @@ class Util {
// Have we changed our local view mode of this room?
const tags = room.tags;
if (tags && tags["ui_options"]) {
console.error("We have a tag!");
if (tags["ui_options"]["voice_mode"] === 1) {
return ROOM_TYPE_VOICE_MODE;
} else if (tags["ui_options"]["file_mode"] === 1) {
@ -897,6 +894,10 @@ class Util {
});
}
downloadableTypes() {
return ['m.video','m.audio','m.image','m.file'];
}
download(matrixClient, event) {
this
.getAttachment(matrixClient, event)