Allow poll answers and quick reactions on read only room
This commit is contained in:
parent
60d536062b
commit
cd2640a85a
4 changed files with 26 additions and 7 deletions
|
|
@ -41,7 +41,9 @@
|
||||||
v-on:download="download(selectedEvent)" v-on:more="
|
v-on:download="download(selectedEvent)" v-on:more="
|
||||||
isEmojiQuickReaction= true
|
isEmojiQuickReaction= true
|
||||||
showMoreMessageOperations({event: selectedEvent, anchor: $event.anchor})
|
showMoreMessageOperations({event: selectedEvent, anchor: $event.anchor})
|
||||||
" :originalEvent="selectedEvent" :timelineSet="timelineSet" />
|
" :originalEvent="selectedEvent" :timelineSet="timelineSet"
|
||||||
|
:readOnlyRoom="$matrix.currentRoomIsReadOnlyForUser"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ref="avatarOperationsStrut" class="avatar-operations-strut">
|
<div ref="avatarOperationsStrut" class="avatar-operations-strut">
|
||||||
|
|
|
||||||
|
|
@ -477,14 +477,25 @@ export default {
|
||||||
// Set power level event. Need to do that here, because we might not have the userId when the options object is created.
|
// Set power level event. Need to do that here, because we might not have the userId when the options object is created.
|
||||||
const powerLevels = {};
|
const powerLevels = {};
|
||||||
powerLevels[this.$matrix.currentUserId] = 100;
|
powerLevels[this.$matrix.currentUserId] = 100;
|
||||||
|
let powerLevelContent = {
|
||||||
|
users: powerLevels,
|
||||||
|
events_default: this.readOnlyRoom ? 50 : 0
|
||||||
|
}
|
||||||
|
if (this.readOnlyRoom) {
|
||||||
|
powerLevelContent.events = {
|
||||||
|
"m.room.encrypted": 0, // NOTE! Since practically all events in encrypted rooms get sent as "m.room.encrypted" we need to set
|
||||||
|
// power to 0 here. Otherwise we would not be able to send quick reactions or poll responses...
|
||||||
|
"m.poll.response": 0,
|
||||||
|
"org.matrix.msc3381.poll.response": 0,
|
||||||
|
"m.reaction": 0,
|
||||||
|
"m.room.redaction": 0,
|
||||||
|
};
|
||||||
|
}
|
||||||
createRoomOptions.initial_state.push(
|
createRoomOptions.initial_state.push(
|
||||||
{
|
{
|
||||||
type: "m.room.power_levels",
|
type: "m.room.power_levels",
|
||||||
state_key: "",
|
state_key: "",
|
||||||
content: {
|
content: powerLevelContent
|
||||||
users: powerLevels,
|
|
||||||
events_default: this.readOnlyRoom ? 50 : 0
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return this.$matrix.matrixClient
|
return this.$matrix.matrixClient
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
</v-avatar>
|
</v-avatar>
|
||||||
<!-- SLOT FOR CONTENT -->
|
<!-- SLOT FOR CONTENT -->
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
<div class="op-button" ref="opbutton" v-if="!event.isRedacted() && !$matrix.currentRoomIsReadOnlyForUser">
|
<div class="op-button" ref="opbutton" v-if="!event.isRedacted()">
|
||||||
<v-btn id="btn-more" icon @click.stop="showContextMenu($refs.opbutton)">
|
<v-btn id="btn-more" icon @click.stop="showContextMenu($refs.opbutton)">
|
||||||
<v-icon>more_vert</v-icon>
|
<v-icon>more_vert</v-icon>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
<v-btn id="btn-more" icon @click.stop="more" class="ma-0 pa-0">
|
<v-btn id="btn-more" icon @click.stop="more" class="ma-0 pa-0">
|
||||||
<v-icon small> $vuetify.icons.addReaction </v-icon>
|
<v-icon small> $vuetify.icons.addReaction </v-icon>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
<v-btn v-if="incoming" id="btn-reply" icon @click.stop="addReply" class="ma-0 pa-0">
|
<v-btn v-if="incoming && !readOnlyRoom" id="btn-reply" icon @click.stop="addReply" class="ma-0 pa-0">
|
||||||
<v-icon>reply</v-icon>
|
<v-icon>reply</v-icon>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
<v-btn id="btn-edit" icon @click.stop="edit" class="ma-0 pa-0" v-if="isEditable">
|
<v-btn id="btn-edit" icon @click.stop="edit" class="ma-0 pa-0" v-if="isEditable">
|
||||||
|
|
@ -40,6 +40,12 @@ export default {
|
||||||
default: function () {
|
default: function () {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
readOnlyRoom: {
|
||||||
|
type: Boolean,
|
||||||
|
default: function () {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue