keanu-weblite/src/components/roomDisplayOptionsMixin.js
N-Pex 3630690b20 Hide own joins for direct rooms
Move display options to a new "roomDisplayOptionsMixin". Rename (and invert) "showOnlyUserStatusMessages" to "showAllStatusMessages".
2023-09-28 09:13:12 +02:00

18 lines
No EOL
642 B
JavaScript

export default {
computed: {
showOwnJoins() {
return !this.$matrix.isDirectRoom(this.room);
},
showAllStatusMessages() {
// We say that if you can redact events, you are ad admin.
// NOTE!!! This assumes that there is a property named "room" on THIS.
const me = this.room && this.room.getMember(this.$matrix.currentUserId);
let isModerator =
me && this.room.currentState && this.room.currentState.hasSufficientPowerLevelFor("redact", me.powerLevel);
const show = this.$config.show_status_messages;
return show !== "never" && (show !== "moderators" || isModerator)
},
},
}