Skip to content

Commit dd531f6

Browse files
haorwencnb
authored andcommitted
chore: bump version to v0.9.75 and enhance message logging in chat handler
1 parent 8324bd4 commit dd531f6

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vocechat-web",
3-
"version": "0.9.74",
3+
"version": "0.9.75",
44
"homepage": "https://voce.chat",
55
"dependencies": {
66
"@metamask/onboarding": "^1.0.1",

src/hooks/useStreaming/chat.handler.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,23 @@ const handler = (
141141
);
142142
// }
143143
});
144+
// 推给 PC 端(自己发的不推送)
145+
if (!self) {
146+
const state = store.getState();
147+
const sender = state.users.byId[from_uid]?.name ?? "";
148+
const channel =
149+
to === "channel"
150+
? state.channels.byId[id]?.name ?? ""
151+
: state.users.byId[id]?.name ?? "";
152+
const text =
153+
content_type === ContentTypes.file
154+
? "[文件]"
155+
: truncate(content, 100);
156+
console.info(
157+
"{{NEW_MSG}}" +
158+
JSON.stringify({ channel, sender, content: text })
159+
);
160+
}
144161
}
145162
break;
146163
case "reaction":

0 commit comments

Comments
 (0)