parent
d90aa3bce2
commit
8e50ec64d3
6 changed files with 21 additions and 9 deletions
|
|
@ -868,7 +868,7 @@ export default {
|
||||||
|
|
||||||
sendAttachment() {
|
sendAttachment() {
|
||||||
if (this.currentImageInputPath) {
|
if (this.currentImageInputPath) {
|
||||||
this.currentSendProgress = 0;
|
this.currentSendProgress = null;
|
||||||
this.currentSendOperation = util.sendImage(
|
this.currentSendOperation = util.sendImage(
|
||||||
this.$matrix.matrixClient,
|
this.$matrix.matrixClient,
|
||||||
this.roomId,
|
this.roomId,
|
||||||
|
|
@ -879,12 +879,12 @@ export default {
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.currentSendOperation = null;
|
this.currentSendOperation = null;
|
||||||
this.currentImageInput = null;
|
this.currentImageInput = null;
|
||||||
this.currentSendProgress = 0;
|
this.currentSendProgress = null;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
this.currentSendError = err.toLocaleString();
|
this.currentSendError = err.toLocaleString();
|
||||||
this.currentSendOperation = null;
|
this.currentSendOperation = null;
|
||||||
this.currentSendProgress = 0;
|
this.currentSendProgress = null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -895,7 +895,7 @@ export default {
|
||||||
}
|
}
|
||||||
this.currentSendOperation = null;
|
this.currentSendOperation = null;
|
||||||
this.currentImageInput = null;
|
this.currentImageInput = null;
|
||||||
this.currentSendProgress = 0;
|
this.currentSendProgress = null;
|
||||||
this.currentSendError = null;
|
this.currentSendError = null;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -215,7 +215,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
userAvatarLetter() {
|
userAvatarLetter() {
|
||||||
if (!this.currentUser) {
|
if (!this.currentUser || !this.currentUser.userId) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return (this.userDisplayName || this.currentUser.userId.substring(1)).substring(0, 1).toUpperCase();
|
return (this.userDisplayName || this.currentUser.userId.substring(1)).substring(0, 1).toUpperCase();
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<!-- Contact invited to the chat -->
|
<!-- Contact invited to the chat -->
|
||||||
<div class="messageJoin">
|
<div class="messageJoin">
|
||||||
{{ stateEventDisplayName(event) }} was invited to the chat...
|
{{ event.getContent().displayname || stateEventDisplayName(event) }} was invited to the chat...
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
src: null,
|
src: null,
|
||||||
cover: true,
|
cover: true,
|
||||||
contain: false
|
contain: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="bubble image-bubble">
|
<div class="bubble image-bubble">
|
||||||
<v-img :aspect-ratio="16 / 9" ref="image" :src="src" cover />
|
<v-img :aspect-ratio="16 / 9" ref="image" :src="src" :cover="cover" :contain="contain" />
|
||||||
<QuickReactions :event="event" :reactions="reactions" />
|
<QuickReactions :event="event" :reactions="reactions" />
|
||||||
</div>
|
</div>
|
||||||
<v-avatar class="avatar" size="32" color="#ededed" @click.stop="ownAvatarClicked">
|
<v-avatar class="avatar" size="32" color="#ededed" @click.stop="ownAvatarClicked">
|
||||||
|
|
@ -32,6 +32,8 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
src: null,
|
src: null,
|
||||||
|
cover: true,
|
||||||
|
contain: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
@ -40,6 +42,16 @@ export default {
|
||||||
util
|
util
|
||||||
.getThumbnail(this.$matrix.matrixClient, this.event, width, height)
|
.getThumbnail(this.$matrix.matrixClient, this.event, width, height)
|
||||||
.then((url) => {
|
.then((url) => {
|
||||||
|
const info = this.event.getContent().info;
|
||||||
|
// JPEGs use cover, PNG and GIF ect contain. This is because PNG and GIF are expected to
|
||||||
|
// be stickers and small emoji type things.
|
||||||
|
if (info && info.mimetype && info.mimetype.startsWith("image/jp")) {
|
||||||
|
this.cover = true;
|
||||||
|
this.contain = false;
|
||||||
|
} else {
|
||||||
|
this.cover = false;
|
||||||
|
this.contain = true;
|
||||||
|
}
|
||||||
this.src = url;
|
this.src = url;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
|
||||||
|
|
@ -276,7 +276,7 @@ class Util {
|
||||||
|
|
||||||
const jwk = {
|
const jwk = {
|
||||||
kty: 'oct',
|
kty: 'oct',
|
||||||
key_opts: ['encrypt', 'decrypt'],
|
key_ops: ['encrypt', 'decrypt'],
|
||||||
alg: 'A256CTR',
|
alg: 'A256CTR',
|
||||||
k: base64Url.encode(key),
|
k: base64Url.encode(key),
|
||||||
ext: true
|
ext: true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue