Unify room welcome header handling

Also, add the "WelcomeHeaderChannel" component
This commit is contained in:
N-Pex 2024-04-03 09:35:20 +02:00
parent 0dc449feaa
commit e28c58d8ba
8 changed files with 134 additions and 56 deletions

View file

@ -14,6 +14,7 @@ export default {
editedRoomTopic: "",
isRoomTopicEditMode: false,
roomTopicErrorMessage: null,
messageRetentionDisplay: "",
retentionPeriods: [
{
text: this.$t("room_info.message_retention_none"),
@ -49,6 +50,7 @@ export default {
mounted() {
this.$matrix.on("Room.timeline", this.roomInfoMixinOnEvent);
this.updatePermissions();
this.updateMessageRetention();
},
destroyed() {
@ -253,14 +255,19 @@ export default {
},
roomInfoMixinOnEvent(event) {
if (event.getRoomId() !== this.roomId) {
return; // Not for this room
}
if (event.getType() == "m.room.join_rules" || event.getType() == "m.room.guest_access") {
this.updatePermissions();
if (this.room && this.room.roomId == event.getRoomId()) {
if (event.getType() == "m.room.join_rules" || event.getType() == "m.room.guest_access") {
this.updatePermissions();
} else if (event.getType() == "m.room.retention") {
this.updateMessageRetention(event);
}
}
},
updateMessageRetention(event) {
this.messageRetentionDisplay = this.roomMessageRetentionDisplay(event);
},
privatePartyAvatar(size) {
const other = this.privateParty;
if (other) {