Initial implementation of "audio mode"

This commit is contained in:
N Pex 2023-01-30 08:36:02 +00:00
parent d5942fdb8e
commit 09173a65f1
14 changed files with 944 additions and 410 deletions

View file

@ -165,6 +165,16 @@
</v-card-text>
</v-card>
<v-card class="account ma-3" flat>
<v-card-title class="h2">{{ $t("room_info.ui_options") }}</v-card-title>
<v-card-text>
<v-switch
v-model="useAudioLayout"
:label="$t('room_info.audio_layout')"
></v-switch>
</v-card-text>
</v-card>
<v-card class="members ma-3" flat>
<v-card-title class="h2"
>{{ $t("room_info.members") }}<v-spacer></v-spacer>
@ -319,7 +329,7 @@ export default {
],
SHOW_MEMBER_LIMIT: 5,
exporting: false,
};
};
},
mounted() {
this.$matrix.on("Room.timeline", this.onEvent);
@ -362,6 +372,26 @@ export default {
}
return "";
},
useAudioLayout: {
get: function () {
if (this.room) {
const tags = this.room.tags;
if (tags && tags["ui_options"]) {
return tags["ui_options"]["audio_layout"] === 1;
}
}
return false;
},
set: function (audioLayout) {
if (this.room && this.room.tags) {
let options = this.room.tags["ui_options"] || {}
options["audio_layout"] = (audioLayout ? 1 : 0);
this.room.tags["ui_options"] = options;
this.$matrix.matrixClient.setRoomTag(this.room.roomId, "ui_options", options);
}
},
}
},
watch: {