Hide own joins for direct rooms
Move display options to a new "roomDisplayOptionsMixin". Rename (and invert) "showOnlyUserStatusMessages" to "showAllStatusMessages".
This commit is contained in:
parent
979e650f0d
commit
3630690b20
2 changed files with 34 additions and 20 deletions
18
src/components/roomDisplayOptionsMixin.js
Normal file
18
src/components/roomDisplayOptionsMixin.js
Normal 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)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue