check if conversation is readonly on frontend

Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
This commit is contained in:
Maksim Sukharev 2023-03-13 12:46:24 +01:00
parent 4a5e43c495
commit e6883f4f5f
No known key found for this signature in database
GPG key ID: 6349D071889BD1D5
3 changed files with 2 additions and 6 deletions

View file

@ -156,10 +156,6 @@ class Message {
* Specifies whether a message can be replied to
*/
public function isReplyable(): bool {
if ($this->getRoom()->getReadOnly() === Room::READ_ONLY) {
return false;
}
return $this->getMessageType() !== ChatManager::VERB_SYSTEM &&
$this->getMessageType() !== ChatManager::VERB_COMMAND &&
$this->getMessageType() !== ChatManager::VERB_MESSAGE_DELETED &&

View file

@ -139,7 +139,7 @@ describe('MessageButtonsBar.vue', () => {
})
const replyButton = findNcButton(wrapper, 'Reply')
expect(replyButton.isVisible()).toBe(false)
expect(replyButton.exists()).toBe(false)
})
})

View file

@ -33,7 +33,7 @@
<EmoticonOutline :size="20" />
</template>
</NcButton>
<NcButton v-show="isReplyable"
<NcButton v-if="isReplyable && !isConversationReadOnly"
type="tertiary"
:aria-label="t('spreed', 'Reply')"
:title="t('spreed', 'Reply')"