2021-04-15 11:44:58 +02:00
|
|
|
<template>
|
|
|
|
|
<div :class="messageClasses">
|
|
|
|
|
<v-avatar class="avatar" size="32" color="#ededed">
|
|
|
|
|
<img v-if="messageEventAvatar(event)" :src="messageEventAvatar(event)" />
|
|
|
|
|
<span v-else class="white--text headline">{{
|
|
|
|
|
messageEventDisplayName(event).substring(0, 1).toUpperCase()
|
|
|
|
|
}}</span>
|
|
|
|
|
</v-avatar>
|
2021-05-06 23:12:02 +02:00
|
|
|
<QuickReactions :event="event" :reactions="reactions" />
|
2021-04-15 11:44:58 +02:00
|
|
|
<div class="bubble sticker-bubble">
|
2021-05-06 23:12:02 +02:00
|
|
|
<v-img
|
|
|
|
|
:aspect-ratio="16 / 9"
|
|
|
|
|
ref="image"
|
|
|
|
|
:src="src"
|
|
|
|
|
:cover="cover"
|
|
|
|
|
:contain="contain"
|
|
|
|
|
/>
|
2021-04-15 11:44:58 +02:00
|
|
|
</div>
|
|
|
|
|
<div class="op-button" ref="opbutton">
|
|
|
|
|
<v-btn icon @click.stop="showContextMenu($refs.opbutton)"
|
|
|
|
|
><v-icon>more_vert</v-icon></v-btn
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="showSenderAndTime" class="senderAndTime">
|
|
|
|
|
<div class="sender">{{ messageEventDisplayName(event) }}</div>
|
|
|
|
|
<div class="time">
|
|
|
|
|
{{ formatTime(event.event.origin_server_ts) }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import messageMixin from "./messageMixin";
|
|
|
|
|
import stickers from "../../plugins/stickers";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
mixins: [messageMixin],
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
src: null,
|
|
|
|
|
cover: false,
|
|
|
|
|
contain: true,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
//console.log("Mounted with event:", JSON.stringify(this.event.getContent()));
|
2021-05-06 23:12:02 +02:00
|
|
|
this.src = stickers.getStickerImage(this.event.getContent().body);
|
2021-04-15 11:44:58 +02:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
@import "@/assets/css/chat.scss";
|
|
|
|
|
</style>
|