Handle m.room.guest_access events.
This commit is contained in:
parent
86f03c0fc2
commit
9223db56a6
2 changed files with 39 additions and 0 deletions
|
|
@ -451,6 +451,7 @@ import RoomAvatarChanged from "./messages/RoomAvatarChanged.vue";
|
|||
import RoomHistoryVisibility from "./messages/RoomHistoryVisibility.vue";
|
||||
import RoomJoinRules from "./messages/RoomJoinRules.vue";
|
||||
import RoomPowerLevelsChanged from "./messages/RoomPowerLevelsChanged.vue";
|
||||
import RoomGuestAccessChanged from "./messages/RoomGuestAccessChanged.vue";
|
||||
import RoomEncrypted from "./messages/RoomEncrypted.vue";
|
||||
import DebugEvent from "./messages/DebugEvent.vue";
|
||||
import util from "../plugins/utils";
|
||||
|
|
@ -530,6 +531,7 @@ export default {
|
|||
RoomHistoryVisibility,
|
||||
RoomJoinRules,
|
||||
RoomPowerLevelsChanged,
|
||||
RoomGuestAccessChanged,
|
||||
RoomEncrypted,
|
||||
DebugEvent,
|
||||
MessageOperations,
|
||||
|
|
@ -1049,6 +1051,9 @@ export default {
|
|||
case "m.room.power_levels":
|
||||
return RoomPowerLevelsChanged;
|
||||
|
||||
case "m.room.guest_access":
|
||||
return RoomGuestAccessChanged;
|
||||
|
||||
case "m.room.encryption":
|
||||
return RoomEncrypted;
|
||||
}
|
||||
|
|
|
|||
34
src/components/messages/RoomGuestAccessChanged.vue
Normal file
34
src/components/messages/RoomGuestAccessChanged.vue
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<template>
|
||||
<div class="statusEvent">
|
||||
{{
|
||||
openToGuests
|
||||
? $t("message.user_changed_guest_access_open", {
|
||||
user: stateEventDisplayName(event),
|
||||
})
|
||||
: $t("message.user_changed_guest_access_closed", {
|
||||
user: stateEventDisplayName(event),
|
||||
})
|
||||
}}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import messageMixin from "./messageMixin";
|
||||
|
||||
export default {
|
||||
mixins: [messageMixin],
|
||||
computed: {
|
||||
openToGuests() {
|
||||
const access = this.event.getContent().guest_access;
|
||||
if (access && access == "forbidden") {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "@/assets/css/chat.scss";
|
||||
</style>
|
||||
Loading…
Add table
Add a link
Reference in a new issue