支持加密图片与视频的本机预览
This commit is contained in:
1 parent
87676ae983
commit
6b728a0996
10 files changed
+94
-7
No files matched your search
@@ -9,6 +9,7 @@ import { downloadAttachment } from '../chat/attachments'
|
||||
import type { Attachment } from '../chat/attachments'
|
||||
import VoiceRecorder from '../chat/VoiceRecorder.vue'
|
||||
import VoiceMessage from '../chat/VoiceMessage.vue'
|
||||
import MediaPreview from '../chat/MediaPreview.vue'
|
||||
|
||||
const session = useSession()
|
||||
const route = useRoute()
|
||||
@@ -370,8 +371,11 @@ onBeforeUnmount(() => {
|
||||
<blockquote v-if="line.quote">{{ line.quote }}</blockquote>
|
||||
<span v-if="line.recalled" class="muted">消息已撤回</span>
|
||||
<VoiceMessage v-else-if="line.attachment?.voice" :attachment="line.attachment" />
|
||||
<button v-else-if="line.attachment" type="button" class="plain" :disabled="busy"
|
||||
@click="saveAttachment(line.attachment)">下载 {{ line.attachment.name }}</button>
|
||||
<template v-else-if="line.attachment">
|
||||
<MediaPreview v-if="line.attachment.media" :attachment="line.attachment" />
|
||||
<button type="button" class="plain" :disabled="busy"
|
||||
@click="saveAttachment(line.attachment)">下载 {{ line.attachment.name }}</button>
|
||||
</template>
|
||||
<span v-else><template v-for="(part, index) in messageParts(line.text)" :key="index"><button v-if="part.url && internalBrowser"
|
||||
type="button" class="chat-link" @click="openLink(part.url)">{{ part.text }}</button><a v-else-if="part.url"
|
||||
class="chat-link" :href="part.url" target="_blank" rel="noopener noreferrer">{{ part.text }}</a><template v-else>{{ part.text }}</template></template></span>
|
||||
|
||||
Reference in new issue
Block a user