feat(shangwutong): render inbound images inline
This commit is contained in:
@@ -10,6 +10,7 @@ import { useI18n } from 'vue-i18n';
|
||||
import MessageFormatter from 'shared/helpers/MessageFormatter.js';
|
||||
import { BUS_EVENTS } from 'shared/constants/busEvents';
|
||||
import { MESSAGE_VARIANTS, ORIENTATION } from '../constants';
|
||||
import { formatShangwutongInlineContent } from '../inlineMedia.js';
|
||||
|
||||
const props = defineProps({
|
||||
hideMeta: { type: Boolean, default: false },
|
||||
@@ -77,11 +78,19 @@ const shouldShowMeta = computed(
|
||||
);
|
||||
|
||||
const replyToPreview = computed(() => {
|
||||
if (!inReplyTo) return '';
|
||||
if (!inReplyTo?.value) return '';
|
||||
|
||||
const { content, attachments } = inReplyTo.value;
|
||||
const { content, attachments, contentAttributes, content_attributes } =
|
||||
inReplyTo.value;
|
||||
|
||||
if (content) return new MessageFormatter(content).formattedMessage;
|
||||
if (content) {
|
||||
const formattedContent = formatShangwutongInlineContent(
|
||||
content,
|
||||
attachments,
|
||||
contentAttributes ?? content_attributes
|
||||
);
|
||||
return new MessageFormatter(formattedContent).formattedMessage;
|
||||
}
|
||||
if (attachments?.length) {
|
||||
const firstAttachment = attachments[0];
|
||||
const fileType = firstAttachment.fileType ?? firstAttachment.file_type;
|
||||
|
||||
Reference in New Issue
Block a user