2020-11-25 14:42:50 +01:00
|
|
|
<template>
|
2020-12-14 16:11:45 +01:00
|
|
|
<div :class="{'message-operations':true,'incoming':incoming,'outgoing':!incoming}">
|
2022-05-16 14:11:55 +00:00
|
|
|
<template v-for="(item,index) in getEmojis">
|
2024-04-26 16:44:06 +02:00
|
|
|
<v-btn v-if="userCanSendReactionAndAnswerPoll && index < maxRecents" :key="item.data" id="btn-quick-reaction" icon @click.stop="addQuickReaction(item.data)" class="ma-0 pa-0" dense>
|
2021-06-22 17:38:16 +05:30
|
|
|
<span class="recent-emoji">{{ item.data }}</span>
|
2021-04-09 14:03:40 +02:00
|
|
|
</v-btn>
|
|
|
|
|
</template>
|
2024-04-26 16:44:06 +02:00
|
|
|
<v-btn v-if="userCanSendReactionAndAnswerPoll" id="btn-more" icon @click.stop="more" class="ma-0 pa-0">
|
2022-05-16 14:11:55 +00:00
|
|
|
<v-icon small> $vuetify.icons.addReaction </v-icon>
|
|
|
|
|
</v-btn>
|
2024-04-26 16:44:06 +02:00
|
|
|
<v-btn v-if="userCanSendMessage" id="btn-reply" icon @click.stop="addReply" class="ma-0 pa-0">
|
2020-12-14 16:11:45 +01:00
|
|
|
<v-icon>reply</v-icon>
|
|
|
|
|
</v-btn>
|
2022-05-16 14:11:55 +00:00
|
|
|
<v-btn id="btn-edit" icon @click.stop="edit" class="ma-0 pa-0" v-if="isEditable">
|
|
|
|
|
<v-icon small>edit</v-icon>
|
|
|
|
|
</v-btn>
|
|
|
|
|
<v-btn id="btn-redact" icon @click.stop="redact" class="ma-0 pa-0" v-if="isRedactable">
|
|
|
|
|
<v-icon small>delete</v-icon>
|
|
|
|
|
</v-btn>
|
|
|
|
|
<v-btn id="btn-download" icon @click.stop="download" class="ma-0 pa-0" v-if="isDownloadable">
|
|
|
|
|
<v-icon small>get_app</v-icon>
|
|
|
|
|
</v-btn>
|
|
|
|
|
</div>
|
2020-11-25 14:42:50 +01:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import messageMixin from "./messageMixin";
|
2021-04-09 14:03:40 +02:00
|
|
|
import messageOperationsMixin from "./messageOperationsMixin";
|
2020-11-25 14:42:50 +01:00
|
|
|
|
|
|
|
|
export default {
|
2021-04-09 14:03:40 +02:00
|
|
|
mixins: [messageMixin, messageOperationsMixin],
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2022-03-21 07:50:31 +00:00
|
|
|
maxRecents: 3
|
2021-04-09 14:03:40 +02:00
|
|
|
}
|
|
|
|
|
},
|
2020-11-25 14:42:50 +01:00
|
|
|
props: {
|
2021-04-09 14:03:40 +02:00
|
|
|
emojis: {
|
|
|
|
|
type: Array,
|
2020-11-25 14:42:50 +01:00
|
|
|
default: function () {
|
2021-04-09 14:03:40 +02:00
|
|
|
return []
|
2020-11-25 14:42:50 +01:00
|
|
|
}
|
2024-02-13 12:13:34 +01:00
|
|
|
},
|
2024-04-26 16:44:06 +02:00
|
|
|
userCanSendMessage: {
|
2024-02-13 12:13:34 +01:00
|
|
|
type: Boolean,
|
|
|
|
|
default: function () {
|
2024-04-26 16:44:06 +02:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
userCanSendReactionAndAnswerPoll: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: function() {
|
|
|
|
|
return true;
|
2024-02-13 12:13:34 +01:00
|
|
|
}
|
2021-04-09 14:03:40 +02:00
|
|
|
}
|
2020-11-25 14:42:50 +01:00
|
|
|
},
|
2022-05-16 14:11:55 +00:00
|
|
|
computed: {
|
|
|
|
|
getEmojis() {
|
|
|
|
|
return this.emojis.slice(0,2);
|
|
|
|
|
}
|
|
|
|
|
},
|
2022-03-21 07:50:31 +00:00
|
|
|
|
2021-04-09 14:03:40 +02:00
|
|
|
watch: {
|
|
|
|
|
emojis: {
|
|
|
|
|
immediate: true,
|
|
|
|
|
handler(newVal, oldVal) {
|
|
|
|
|
console.log("Emojis changed", newVal, oldVal);
|
2021-02-08 15:31:09 +01:00
|
|
|
}
|
2020-12-14 16:11:45 +01:00
|
|
|
},
|
2021-04-09 14:03:40 +02:00
|
|
|
},
|
2020-11-25 14:42:50 +01:00
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
@import "@/assets/css/chat.scss";
|
|
|
|
|
</style>
|