2020-11-17 21:24:03 +01:00
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<div class="messageOut">
|
|
|
|
|
<div class="sender">{{ "You" }}</div>
|
2020-11-19 17:08:58 +01:00
|
|
|
<div class="bubble image-bubble">
|
|
|
|
|
<v-img :aspect-ratio="16/9" ref="image" :src="src" cover />
|
2020-11-17 21:24:03 +01:00
|
|
|
</div>
|
|
|
|
|
<div class="status">{{ event.status }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="time">
|
|
|
|
|
{{ formatTime(event.event.origin_server_ts) }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import messageMixin from "./messageMixin";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
mixins: [messageMixin],
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
src: null
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
const width = this.$refs.image.$el.clientWidth;
|
|
|
|
|
const height = (width * 9) / 16;
|
|
|
|
|
this.src = this.$matrix.matrixClient.mxcUrlToHttp(this.event.getContent().url, width, height, 'scale', false);
|
2020-11-19 17:08:58 +01:00
|
|
|
},
|
|
|
|
|
beforeDestroy() {
|
|
|
|
|
if (this.src) {
|
|
|
|
|
const objectUrl = this.src;
|
|
|
|
|
this.src = null;
|
|
|
|
|
URL.revokeObjectURL(objectUrl);
|
|
|
|
|
}
|
2020-11-17 21:24:03 +01:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
@import "@/assets/css/chat.scss";
|
|
|
|
|
</style>
|