jbc-dssi 1.1.42 → 1.1.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -171,8 +171,20 @@ export function createRoundEngine({ ctx, state, dssAgent, log, save, broadcast,
|
|
|
171
171
|
})),
|
|
172
172
|
].filter((a) => a.ref);
|
|
173
173
|
|
|
174
|
+
/*
|
|
175
|
+
* 发送者身份(2026-11-04 跨账号身份错位修复):
|
|
176
|
+
* role='user' 只说明"这是人说的话",**不说明是哪个账号**;
|
|
177
|
+
* 被拉进群的好友如果看到 role=user 就当成"自己发的"(右侧绿气泡),就会错位。
|
|
178
|
+
* 所以这里落盘时带上发送者 userId + 昵称;客户端按"是否等于当前登录账号"决定左右。
|
|
179
|
+
* 老数据没有这两个字段 → 客户端按旧行为(当自己)处理,不做历史回填。
|
|
180
|
+
*/
|
|
181
|
+
const sender = attachments?.sender ?? {};
|
|
182
|
+
const senderUserId = typeof sender?.userId === 'string' ? sender.userId : '';
|
|
183
|
+
const senderName = typeof sender?.nickname === 'string' ? sender.nickname : '';
|
|
174
184
|
emitLine(group.id, {
|
|
175
185
|
at: now(), role: 'user', name: '你', text: body,
|
|
186
|
+
senderUserId,
|
|
187
|
+
senderName,
|
|
176
188
|
attachments: attachmentMeta,
|
|
177
189
|
});
|
|
178
190
|
|
|
@@ -320,7 +320,12 @@ export function createGroupsEngine({
|
|
|
320
320
|
const heartbeat = setInterval(() => { void pendingTasks.touch(taskId); }, 5_000);
|
|
321
321
|
heartbeat.unref?.();
|
|
322
322
|
try {
|
|
323
|
-
|
|
323
|
+
// 发送者身份(2026-11-04):谁发的这条用户消息,供多账号/好友进群时正确分左右
|
|
324
|
+
const sender = {
|
|
325
|
+
userId: typeof payload?.senderUserId === 'string' ? payload.senderUserId : '',
|
|
326
|
+
nickname: typeof payload?.senderNickname === 'string' ? payload.senderNickname : '',
|
|
327
|
+
};
|
|
328
|
+
await engine.handleUserMessage(group, members, text, { images, files, sender }, {
|
|
324
329
|
onProgress: (patch) => { void pendingTasks.touch(taskId, patch); },
|
|
325
330
|
});
|
|
326
331
|
} finally {
|