Resolve "(File Drop Mode) : File sent from the user in file drop mode is not received by another user"

This commit is contained in:
N Pex 2023-08-01 10:14:10 +00:00
parent d718ee06b8
commit 48cb13c82b
8 changed files with 68 additions and 18 deletions

View file

@ -117,22 +117,10 @@ export default {
},
onLeaveRoom() {
const lastRoom = this.onlyJoinedToThisRoom();
//this.$matrix.matrixClient.forget(this.room.roomId, true, undefined)
const roomId = this.room.roomId;
this.$matrix
.leaveRoom(roomId)
this.$matrix.leaveRoomAndNavigate(this.room.roomId)
.then(() => {
this.showDialog = false;
console.log("Left room");
if (lastRoom) {
this.$navigation.push({ name: "Goodbye" }, -1);
} else {
this.$navigation.push(
{ name: "Home", params: { roomId: null } },
-1
);
}
})
.catch((err) => {
console.log("Error leaving", err);

View file

@ -154,7 +154,7 @@ export default {
case "m.room.message":
if (event.getSender() != this.$matrix.currentUserId) {
if (event.isThreadRoot) {
if (event.isThreadRoot || event.isThread) {
// Incoming thread, e.g. a file drop!
return MessageIncomingThread;
}

View file

@ -95,7 +95,8 @@
color="#4642F1"></v-progress-circular></v-btn>
</div>
<div v-else-if="status == mainStatuses.SENT" class="file-drop-sent-input-container">
<v-btn @click.stop="reset">{{ $t("file_mode.return_to_home") }}</v-btn>
<v-btn @click.stop="reset">{{ $t("file_mode.send_more_files") }}</v-btn>
<v-btn class="close" @click.stop="close">{{ $t("file_mode.close") }}</v-btn>
</div>
</div>
</template>
@ -211,6 +212,12 @@ export default {
this.messageInput = "";
this.currentItemIndex = 0;
},
close() {
this.$matrix.leaveRoomAndNavigate(this.room.roomId)
.catch((err) => {
console.log("Error leaving", err);
});
},
send() {
this.status = this.mainStatuses.SENDING;
this.sendInfo = this.attachments.map((attachment) => {

View file

@ -2,6 +2,7 @@ import QuickReactions from "./QuickReactions.vue";
import * as linkify from 'linkifyjs';
import linkifyHtml from 'linkify-html';
import utils from "../../plugins/utils"
import Vue from "vue";
linkify.options.defaults.className = "link";
linkify.options.defaults.target = { url: "_blank" };
@ -58,7 +59,26 @@ export default {
}
}
},
beforeUnmount() {
if (this.validEvent) {
this.event.off("Event.relationsCreated", this.onRelationsCreated);
}
},
watch: {
event: {
immediate: true,
handler(newValue, oldValue) {
if (oldValue && oldValue.getId) {
oldValue.off("Event.relationsCreated", this.onRelationsCreated);
}
if (newValue && newValue.getId) {
newValue.on("Event.relationsCreated", this.onRelationsCreated);
if (newValue.isThreadRoot) {
Vue.set(newValue, "isThread", true);
}
}
}
},
originalEvent: {
immediate: true,
handler(originalEvent, ignoredOldValue) {
@ -70,7 +90,7 @@ export default {
});
}
},
},
}
},
computed: {
/**
@ -164,6 +184,11 @@ export default {
},
},
methods: {
onRelationsCreated(relationType, ignoredEventType) {
if (relationType === "m.thread") {
Vue.set(this.event, "isThread", true);
}
},
ownAvatarClicked() {
this.$emit("own-avatar-clicked", { event: this.event });
},