Poll reply fixes and other misc improvements
This commit is contained in:
parent
11a5b195ea
commit
bca0de0660
15 changed files with 42 additions and 39 deletions
20
src/assets/icons/poll.vue
Normal file
20
src/assets/icons/poll.vue
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<template>
|
||||
<svg width="17" height="19" viewBox="0 0 17 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M3.31462 16.4718C3.31462 16.9496 3.70026 17.3368 4.17609 17.3368L16.1385 17.3368C16.6144 17.3368 17 16.9496 17 16.4718L16.9998 13.6229C16.9998 13.1452 16.6142 12.7579 16.1383 12.7579L4.1764 12.7579C3.70056 12.7579 3.31492 13.1452 3.31492 13.6229L3.31512 16.4718L3.31462 16.4718Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path
|
||||
d="M3.31462 10.4557C3.31462 10.9335 3.70026 11.3208 4.17609 11.3208L11.3428 11.3208C11.8186 11.3208 12.2043 10.9335 12.2043 10.4557L12.2043 7.60711C12.2043 7.12931 11.8186 6.74208 11.3428 6.74208L4.17609 6.74208C3.70026 6.74208 3.31462 7.12932 3.31462 7.60711L3.31462 10.4557Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path
|
||||
d="M3.31451 1.59127L3.31451 4.44011C3.31451 4.91791 3.70016 5.30514 4.17598 5.30514L6.99509 5.30514C7.47093 5.30514 7.85657 4.91791 7.85657 4.44011L7.85637 1.59127C7.85637 1.11347 7.47073 0.726242 6.9949 0.726242L4.17599 0.726242C3.70035 0.726242 3.31452 1.11348 3.31452 1.59127L3.31451 1.59127Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path
|
||||
d="M-2.00529e-05 0.587841L-2.0791e-05 17.4747C-2.08052e-05 17.7995 0.262306 18.0625 0.585404 18.0625L1.38198 18.0625C1.70528 18.0625 1.96741 17.7995 1.96741 17.4747L1.96741 0.587841C1.96741 0.263208 1.70508 -1.14667e-08 1.38198 -2.55897e-08L0.585405 -6.04092e-08C0.261911 -7.45496e-08 -2.00387e-05 0.263213 -2.00529e-05 0.587841Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
</svg>
|
||||
</template>
|
||||
|
|
@ -182,6 +182,7 @@
|
|||
"reply_image": "",
|
||||
"reply_audio_message": "",
|
||||
"reply_video": "",
|
||||
"reply_poll": "",
|
||||
"outgoing_message_deleted_text": "",
|
||||
"incoming_message_deleted_text": ""
|
||||
},
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@
|
|||
"reply_image": "Image",
|
||||
"reply_audio_message": "Audio message",
|
||||
"reply_video": "Video",
|
||||
"reply_poll": "Poll",
|
||||
"time_ago": "Today | Yesterday | {count} days ago",
|
||||
"outgoing_message_deleted_text": "You deleted this message.",
|
||||
"incoming_message_deleted_text": "This message was deleted."
|
||||
|
|
|
|||
|
|
@ -191,6 +191,7 @@
|
|||
"reply_image": "Imagen",
|
||||
"reply_audio_message": "Mensaje de audio",
|
||||
"reply_video": "Vídeo",
|
||||
"reply_poll": "",
|
||||
"user_changed_guest_access_closed": "{user} no has permitido que los invitados se unan a la sala",
|
||||
"user_changed_guest_access_open": "{user} has permitido que los invitados se unieran a la sala",
|
||||
"outgoing_message_deleted_text": "",
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
"reply_image": "",
|
||||
"reply_audio_message": "",
|
||||
"reply_video": "",
|
||||
"reply_poll": "",
|
||||
"outgoing_message_deleted_text": "",
|
||||
"incoming_message_deleted_text": ""
|
||||
},
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@
|
|||
"reply_image": "Imagem",
|
||||
"reply_audio_message": "Mensagem de áudio",
|
||||
"reply_video": "Vídeo",
|
||||
"reply_poll": "",
|
||||
"time_ago": "Hoje | Ontem | {count} dias atrás",
|
||||
"outgoing_message_deleted_text": "",
|
||||
"incoming_message_deleted_text": ""
|
||||
|
|
|
|||
|
|
@ -237,6 +237,7 @@
|
|||
"reply_image": "Imagine",
|
||||
"reply_audio_message": "Mesaj audio",
|
||||
"reply_video": "Videoclip",
|
||||
"reply_poll": "",
|
||||
"outgoing_message_deleted_text": "",
|
||||
"incoming_message_deleted_text": ""
|
||||
},
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
"reply_image": "",
|
||||
"reply_audio_message": "",
|
||||
"reply_video": "",
|
||||
"reply_poll": "",
|
||||
"you": "ඔබ",
|
||||
"outgoing_message_deleted_text": "",
|
||||
"incoming_message_deleted_text": ""
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@
|
|||
"reply_image": "",
|
||||
"reply_audio_message": "",
|
||||
"reply_video": "",
|
||||
"reply_poll": "",
|
||||
"outgoing_message_deleted_text": "",
|
||||
"incoming_message_deleted_text": ""
|
||||
},
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@
|
|||
"reply_image": "",
|
||||
"reply_audio_message": "",
|
||||
"reply_video": "",
|
||||
"reply_poll": "",
|
||||
"outgoing_message_deleted_text": "",
|
||||
"incoming_message_deleted_text": ""
|
||||
},
|
||||
|
|
|
|||
|
|
@ -121,11 +121,13 @@
|
|||
<div v-if="replyToContentType === 'm.image'">{{ $t("message.reply_image") }}</div>
|
||||
<div v-if="replyToContentType === 'm.audio'">{{ $t("message.reply_audio_message") }}</div>
|
||||
<div v-if="replyToContentType === 'm.video'">{{ $t("message.reply_video") }}</div>
|
||||
<div v-if="replyToContentType === 'm.poll'">{{ $t("message.reply_poll") }}</div>
|
||||
</div>
|
||||
<div class="col col-auto" v-if="replyToContentType !== 'm.text'">
|
||||
<img v-if="replyToContentType === 'm.image'" width="150px" :src="replyToImg" class="rounded" />
|
||||
<img v-if="replyToContentType === 'm.image'" width="50px" height="50px" :src="replyToImg" class="rounded" />
|
||||
<v-img v-if="replyToContentType === 'm.audio'" src="@/assets/icons/audio_message.svg" />
|
||||
<v-img v-if="replyToContentType === 'm.video'" src="@/assets/icons/video_message.svg" />
|
||||
<v-icon v-if="replyToContentType === 'm.poll'" light>$vuetify.icons.poll</v-icon>
|
||||
</div>
|
||||
<div class="col col-auto">
|
||||
<v-btn fab x-small elevation="0" color="black" @click.stop="cancelEditReply">
|
||||
|
|
@ -1230,7 +1232,7 @@ export default {
|
|||
addReply(event) {
|
||||
this.replyToEvent = event;
|
||||
this.$refs.messageInput.focus();
|
||||
this.replyToContentType = event.getContent().msgtype;
|
||||
this.replyToContentType = event.getContent().msgtype || 'm.poll';
|
||||
this.setReplyToImage(event);
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -2,24 +2,7 @@
|
|||
<message-incoming v-bind="{ ...$props, ...$attrs }" v-on="$listeners">
|
||||
<div class="bubble poll-bubble">
|
||||
<div class="poll-icon">
|
||||
<svg width="17" height="19" viewBox="0 0 17 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M3.31462 16.4718C3.31462 16.9496 3.70026 17.3368 4.17609 17.3368L16.1385 17.3368C16.6144 17.3368 17 16.9496 17 16.4718L16.9998 13.6229C16.9998 13.1452 16.6142 12.7579 16.1383 12.7579L4.1764 12.7579C3.70056 12.7579 3.31492 13.1452 3.31492 13.6229L3.31512 16.4718L3.31462 16.4718Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path
|
||||
d="M3.31462 10.4557C3.31462 10.9335 3.70026 11.3208 4.17609 11.3208L11.3428 11.3208C11.8186 11.3208 12.2043 10.9335 12.2043 10.4557L12.2043 7.60711C12.2043 7.12931 11.8186 6.74208 11.3428 6.74208L4.17609 6.74208C3.70026 6.74208 3.31462 7.12932 3.31462 7.60711L3.31462 10.4557Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path
|
||||
d="M3.31451 1.59127L3.31451 4.44011C3.31451 4.91791 3.70016 5.30514 4.17598 5.30514L6.99509 5.30514C7.47093 5.30514 7.85657 4.91791 7.85657 4.44011L7.85637 1.59127C7.85637 1.11347 7.47073 0.726242 6.9949 0.726242L4.17599 0.726242C3.70035 0.726242 3.31452 1.11348 3.31452 1.59127L3.31451 1.59127Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path
|
||||
d="M-2.00529e-05 0.587841L-2.0791e-05 17.4747C-2.08052e-05 17.7995 0.262306 18.0625 0.585404 18.0625L1.38198 18.0625C1.70528 18.0625 1.96741 17.7995 1.96741 17.4747L1.96741 0.587841C1.96741 0.263208 1.70508 -1.14667e-08 1.38198 -2.55897e-08L0.585405 -6.04092e-08C0.261911 -7.45496e-08 -2.00387e-05 0.263213 -2.00529e-05 0.587841Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
</svg>
|
||||
<v-icon dark>$vuetify.icons.poll</v-icon>
|
||||
</div>
|
||||
|
||||
<div class="poll-question">{{ pollQuestion }}</div>
|
||||
|
|
|
|||
|
|
@ -2,24 +2,7 @@
|
|||
<message-outgoing v-bind="{ ...$props, ...$attrs }" v-on="$listeners">
|
||||
<div class="bubble poll-bubble">
|
||||
<div class="poll-icon">
|
||||
<svg width="17" height="19" viewBox="0 0 17 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M3.31462 16.4718C3.31462 16.9496 3.70026 17.3368 4.17609 17.3368L16.1385 17.3368C16.6144 17.3368 17 16.9496 17 16.4718L16.9998 13.6229C16.9998 13.1452 16.6142 12.7579 16.1383 12.7579L4.1764 12.7579C3.70056 12.7579 3.31492 13.1452 3.31492 13.6229L3.31512 16.4718L3.31462 16.4718Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path
|
||||
d="M3.31462 10.4557C3.31462 10.9335 3.70026 11.3208 4.17609 11.3208L11.3428 11.3208C11.8186 11.3208 12.2043 10.9335 12.2043 10.4557L12.2043 7.60711C12.2043 7.12931 11.8186 6.74208 11.3428 6.74208L4.17609 6.74208C3.70026 6.74208 3.31462 7.12932 3.31462 7.60711L3.31462 10.4557Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path
|
||||
d="M3.31451 1.59127L3.31451 4.44011C3.31451 4.91791 3.70016 5.30514 4.17598 5.30514L6.99509 5.30514C7.47093 5.30514 7.85657 4.91791 7.85657 4.44011L7.85637 1.59127C7.85637 1.11347 7.47073 0.726242 6.9949 0.726242L4.17599 0.726242C3.70035 0.726242 3.31452 1.11348 3.31452 1.59127L3.31451 1.59127Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path
|
||||
d="M-2.00529e-05 0.587841L-2.0791e-05 17.4747C-2.08052e-05 17.7995 0.262306 18.0625 0.585404 18.0625L1.38198 18.0625C1.70528 18.0625 1.96741 17.7995 1.96741 17.4747L1.96741 0.587841C1.96741 0.263208 1.70508 -1.14667e-08 1.38198 -2.55897e-08L0.585405 -6.04092e-08C0.261911 -7.45496e-08 -2.00387e-05 0.263213 -2.00529e-05 0.587841Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
</svg>
|
||||
<v-icon light>$vuetify.icons.poll</v-icon>
|
||||
</div>
|
||||
|
||||
<div class="poll-question">{{ pollQuestion }}</div>
|
||||
|
|
|
|||
|
|
@ -163,9 +163,11 @@ class Util {
|
|||
event_id: replyToEvent.getId()
|
||||
}
|
||||
}
|
||||
let senderContent = replyToEvent.getContent()
|
||||
|
||||
const senderContentBody = Object.getOwnPropertyDescriptor(senderContent,'body') ? senderContent.body : Object.values(senderContent)[0].question.body
|
||||
// Prefix the content with reply info (seems to be a legacy thing)
|
||||
const prefix = replyToEvent.getContent().body.split('\n').map((item, index) => {
|
||||
const prefix = senderContentBody.split('\n').map((item, index) => {
|
||||
return "> " + (index == 0 ? ("<" + replyToEvent.getSender() + "> ") : "") + item;
|
||||
}).join('\n');
|
||||
content.body = prefix + "\n\n" + content.body;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import icPassword from '@/assets/icons/password.vue';
|
|||
import icEdit from '@/assets/icons/edit.vue';
|
||||
import icGlobe from '@/assets/icons/globe.vue';
|
||||
import icAddReaction from '@/assets/icons/addReaction.vue';
|
||||
import icPoll from '@/assets/icons/poll.vue';
|
||||
|
||||
Vue.use(Vuetify);
|
||||
|
||||
|
|
@ -27,6 +28,9 @@ export default new Vuetify({
|
|||
addReaction: {
|
||||
component: icAddReaction
|
||||
},
|
||||
poll: {
|
||||
component: icPoll
|
||||
},
|
||||
},
|
||||
user: icUser
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue