Fix some warning and handle servers that don't support "m.thread" using old "io.element.thread"

This commit is contained in:
N-Pex 2024-06-25 17:43:44 +02:00
parent 23b69b5503
commit ecb4b1717b
2 changed files with 4 additions and 3 deletions

View file

@ -257,7 +257,7 @@
</span> </span>
<v-switch v-if="currentImageInput && currentImageInput.scaled" :label="$t('message.scale_image')" <v-switch v-if="currentImageInput && currentImageInput.scaled" :label="$t('message.scale_image')"
v-model="currentImageInput.useScaled" :disabled="currentImageInput.sendInfo" /> v-model="currentImageInput.useScaled" :disabled="currentImageInput && currentImageInput.sendInfo !== undefined" />
</div> </div>
</div> </div>
</v-card-text> </v-card-text>
@ -283,7 +283,7 @@
{{ $t("menu.cancel") }} {{ $t("menu.cancel") }}
</v-btn> </v-btn>
<v-btn id="btn-attachment-send" color="primary" text @click="sendAttachment(undefined)" <v-btn id="btn-attachment-send" color="primary" text @click="sendAttachment(undefined)"
v-if="currentSendShowSendButton" :disabled="sendingStatus != sendStatuses.INITIAL">{{ $t("menu.send") }}</v-btn> v-if="currentSendShowSendButton" :disabled="currentSendShowSendButton && sendingStatus != sendStatuses.INITIAL">{{ $t("menu.send") }}</v-btn>
</v-card-actions> </v-card-actions>
</template> </template>
</v-card> </v-card>

View file

@ -6,6 +6,7 @@ import { AutoDiscovery } from 'matrix-js-sdk';
import User from '../models/user'; import User from '../models/user';
const prettyBytes = require("pretty-bytes"); const prettyBytes = require("pretty-bytes");
import Hammer from "hammerjs"; import Hammer from "hammerjs";
import { Thread } from 'matrix-js-sdk/lib/models/thread';
export const STATE_EVENT_ROOM_DELETION_NOTICE = "im.keanu.room_deletion_notice"; export const STATE_EVENT_ROOM_DELETION_NOTICE = "im.keanu.room_deletion_notice";
export const STATE_EVENT_ROOM_DELETED = "im.keanu.room_deleted"; export const STATE_EVENT_ROOM_DELETED = "im.keanu.room_deleted";
@ -399,7 +400,7 @@ class Util {
// If thread root (an eventId) is set, add that here // If thread root (an eventId) is set, add that here
if (threadRoot) { if (threadRoot) {
messageContent["m.relates_to"] = { messageContent["m.relates_to"] = {
"rel_type": "m.thread", "rel_type": Thread.hasServerSideSupport ? "m.thread" : "io.element.thread",
"event_id": threadRoot "event_id": threadRoot
}; };
} }