@@ -3,7 +3,7 @@ import { countMentionedGroupMembers, hasEveryoneMention, hasGroupAllMention, mou
33import { createGroupBotIdentities, groupBotIdentity, createGroupBotAvatar } from './group-identity.mjs';
44import { groupMentionPainter } from './group-mentions-display.mjs';
55import { AGENT_FILE_ACCEPT, chatFileDownload, chatUploadProgress, deferModule, localChatFile, mountChatFiles,
6- ownSocialReceipt, renderChatFile, sendPrivateAttachmentMessage, sendSocialAttachmentMessage, unclearSocialDelivery } from './files.mjs';
6+ ownSocialMessage, ownSocialReceipt, renderChatFile, sendPrivateAttachmentMessage, sendSocialAttachmentMessage, unclearSocialDelivery } from './files.mjs';
77import { mountGroupTranslation } from './translation.mjs';
88import { mountChatActivity, mountChatApprovalNotice } from './activity.mjs';
99import { meetingCodeFromHash, meetingDraftFromCallHref, stageMeetingFromChat } from '../shell/meeting-link.mjs';
@@ -1460,7 +1460,7 @@ export function mount(document, {fetcher = globalThis.fetch.bind(globalThis)} =
14601460 function socialMessageAuthor(item, people = currentConversation?.members || members) {
14611461 if (item.role === 'agent') return item.reply_job_id ? groupReplyAuthor(item)
14621462 : (item.agent_name || uiLabel('智能体', 'Agent')) + uiLabel(' · AI 智能体 · 运行时回复', ' · AI agent · DS-Bot');
1463- if (item.user_id === currentUser?.id) return uiLabel('我', 'Me');
1463+ if (ownSocialMessage( item, currentUser?.id) ) return uiLabel('我', 'Me');
14641464 return people.find(entry => entry.user_id === item.user_id)?.username || uiLabel('成员', 'Member');
14651465 }
14661466
@@ -5040,7 +5040,7 @@ export function mount(document, {fetcher = globalThis.fetch.bind(globalThis)} =
50405040 const receipt = await historyPage(history,query,AbortSignal.timeout(4500)).catch(() => null);
50415041 const original = receipt?.status === 200 && Array.isArray(receipt.body.items) && receipt.body.items.find(message =>
50425042 message.id === item.id && !message.retracted && message.conversation_id === cid &&
5043- message.workspace_id === history.wid && message.user_id === history.owner);
5043+ message.workspace_id === history.wid && ownSocialMessage( message, history.owner) );
50445044 next = Array.isArray(original?.reply_jobs) && original.reply_jobs.find(advanced);
50455045 }
50465046 if (groupReplyRetries.get(job.id) !== retry) return;
@@ -5303,7 +5303,7 @@ export function mount(document, {fetcher = globalThis.fetch.bind(globalThis)} =
53035303 }
53045304 li.dataset.messageId = item.id;
53055305 if (Number.isSafeInteger(item.seq)) li.dataset.messageSeq = String(item.seq);
5306- const mine = item.role !== 'agent' && item.user_id === ( currentUser && currentUser .id);
5306+ const mine = ownSocialMessage( item, currentUser? .id);
53075307 li.dataset.chatAuthor = item.role === 'agent' ? 'agent' : 'person';
53085308 li.className = mine ? 'mine' : 'other';
53095309 const role = document.createElement('p');
@@ -5405,7 +5405,7 @@ export function mount(document, {fetcher = globalThis.fetch.bind(globalThis)} =
54055405 confirm.removeAttribute('aria-busy');
54065406 if (currentUser !== owner || workspaceId() !== wid) return;
54075407 const message = result.body?.message;
5408- if (result.status !== 200 || message?.id !== item.id || message.user_id !== owner.id ||
5408+ if (result.status !== 200 || message?.id !== item.id || !ownSocialMessage( message, owner.id) ||
54095409 message.workspace_id !== wid || message.conversation_id !== cid || !Number.isSafeInteger(message.revision) ||
54105410 message.revision <= payload.revision || message.retracted !== (operation === 'retract')) {
54115411 if (scope === sendScope()) {
@@ -8615,7 +8615,7 @@ export function mount(document, {fetcher = globalThis.fetch.bind(globalThis)} =
86158615 const start = Math.max(0, index - 48);
86168616 return {
86178617 kind: 'social', conversation_id: conversationId, message_id: item.id, created: item.created,
8618- role: item.role === 'agent' ? 'assistant' : item.user_id && item.user_id === viewer ? 'user' : '',
8618+ role: item.role === 'agent' ? 'assistant' : ownSocialMessage( item, viewer) ? 'user' : '',
86198619 agent_name: item.agent_name,
86208620 author: item.user_id && people.find(member => member.user_id === item.user_id)?.username,
86218621 snippet: (start > 0 ? '…' : '') + body.slice(start, start + 160) + (body.length > start + 160 ? '…' : ''),
0 commit comments