Resolve "Reduce / hide the room creation status messages"
This commit is contained in:
parent
ce780ea3b0
commit
0905bc34c0
3 changed files with 69 additions and 17 deletions
|
|
@ -44,5 +44,6 @@
|
|||
}
|
||||
],
|
||||
"experimental_voice_mode": true,
|
||||
"experimental_read_only_room": true
|
||||
"experimental_read_only_room": true,
|
||||
"show_status_messages": "never"
|
||||
}
|
||||
|
|
@ -94,6 +94,15 @@ export default {
|
|||
CreatePollDialog,
|
||||
},
|
||||
methods: {
|
||||
showOnlyUserStatusMessages() {
|
||||
// We say that if you can redact events, you are allowed to create polls.
|
||||
// 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)
|
||||
},
|
||||
showDayMarkerBeforeEvent(event) {
|
||||
const idx = this.events.indexOf(event);
|
||||
if (idx <= 0) {
|
||||
|
|
@ -132,10 +141,12 @@ export default {
|
|||
return ContactKicked;
|
||||
}
|
||||
return ContactLeave;
|
||||
} else if (event.getContent().membership == "invite") {
|
||||
return ContactInvited;
|
||||
} else if (event.getContent().membership == "ban") {
|
||||
return ContactBanned;
|
||||
} else if (!this.showOnlyUserStatusMessages()) {
|
||||
if (event.getContent().membership == "invite") {
|
||||
return ContactInvited;
|
||||
} else if (event.getContent().membership == "ban") {
|
||||
return ContactBanned;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -203,34 +214,64 @@ export default {
|
|||
}
|
||||
|
||||
case "m.room.create":
|
||||
return RoomCreated;
|
||||
if (!this.showOnlyUserStatusMessages()) {
|
||||
return RoomCreated;
|
||||
}
|
||||
break;
|
||||
|
||||
case "m.room.canonical_alias":
|
||||
return RoomAliased;
|
||||
if (!this.showOnlyUserStatusMessages()) {
|
||||
return RoomAliased;
|
||||
}
|
||||
break;
|
||||
|
||||
case "m.room.name":
|
||||
return RoomNameChanged;
|
||||
if (!this.showOnlyUserStatusMessages()) {
|
||||
return RoomNameChanged;
|
||||
}
|
||||
break;
|
||||
|
||||
case "m.room.topic":
|
||||
return RoomTopicChanged;
|
||||
if (!this.showOnlyUserStatusMessages()) {
|
||||
return RoomTopicChanged;
|
||||
}
|
||||
break;
|
||||
|
||||
case "m.room.avatar":
|
||||
return RoomAvatarChanged;
|
||||
if (!this.showOnlyUserStatusMessages()) {
|
||||
return RoomAvatarChanged;
|
||||
}
|
||||
break;
|
||||
|
||||
case "m.room.history_visibility":
|
||||
return RoomHistoryVisibility;
|
||||
if (!this.showOnlyUserStatusMessages()) {
|
||||
return RoomHistoryVisibility;
|
||||
}
|
||||
break;
|
||||
|
||||
case "m.room.join_rules":
|
||||
return RoomJoinRules;
|
||||
if (!this.showOnlyUserStatusMessages()) {
|
||||
return RoomJoinRules;
|
||||
}
|
||||
break;
|
||||
|
||||
case "m.room.power_levels":
|
||||
return RoomPowerLevelsChanged;
|
||||
if (!this.showOnlyUserStatusMessages()) {
|
||||
return RoomPowerLevelsChanged;
|
||||
}
|
||||
break;
|
||||
|
||||
case "m.room.guest_access":
|
||||
return RoomGuestAccessChanged;
|
||||
if (!this.showOnlyUserStatusMessages()) {
|
||||
return RoomGuestAccessChanged;
|
||||
}
|
||||
break;
|
||||
|
||||
case "m.room.encryption":
|
||||
return RoomEncrypted;
|
||||
if (!this.showOnlyUserStatusMessages()) {
|
||||
return RoomEncrypted;
|
||||
}
|
||||
break;
|
||||
|
||||
case "m.poll.start":
|
||||
case "org.matrix.msc3381.poll.start":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue