diff --git a/package.json b/package.json index ac5ed218..5414e627 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vocechat-web", - "version": "0.9.74", + "version": "0.9.75", "homepage": "https://voce.chat", "dependencies": { "@metamask/onboarding": "^1.0.1", diff --git a/src/hooks/useStreaming/chat.handler.ts b/src/hooks/useStreaming/chat.handler.ts index 890a7034..2d7859ed 100644 --- a/src/hooks/useStreaming/chat.handler.ts +++ b/src/hooks/useStreaming/chat.handler.ts @@ -141,6 +141,23 @@ const handler = ( ); // } }); + // 推给 PC 端(自己发的不推送) + if (!self) { + const state = store.getState(); + const sender = state.users.byId[from_uid]?.name ?? ""; + const channel = + to === "channel" + ? state.channels.byId[id]?.name ?? "" + : state.users.byId[id]?.name ?? ""; + const text = + content_type === ContentTypes.file + ? "[文件]" + : truncate(content, 100); + console.info( + "{{NEW_MSG}}" + + JSON.stringify({ channel, sender, content: text }) + ); + } } break; case "reaction":