feat(shangwutong): render inbound images inline

This commit is contained in:
2026-09-12 15:26:03 +08:00
parent c415d6d13f
commit 6e62f5094f
9 changed files with 227 additions and 31 deletions
@@ -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;