Hide own joins for direct rooms

Move display options to a new "roomDisplayOptionsMixin". Rename (and invert) "showOnlyUserStatusMessages" to "showAllStatusMessages".
This commit is contained in:
N-Pex 2023-09-28 09:13:12 +02:00
parent 979e650f0d
commit 3630690b20
2 changed files with 34 additions and 20 deletions

View file

@ -0,0 +1,18 @@
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)
},
},
}