|
@@ -1,6 +1,7 @@
|
|
|
import { useWebRTCStore } from "@/stores/modules/webrtcStore";
|
|
|
import { MSG_TYPE, MSG_TYPE_MAP } from "@/common/constant/msgType";
|
|
|
import * as Constant from "@/common/constant/Constant";
|
|
|
+import { setupNotifications } from "@/utils/notifications.js";
|
|
|
|
|
|
// 发送消息处理
|
|
|
export const setMessageHook = (message, state) => {
|
|
@@ -45,6 +46,8 @@ export const handleMessageHook = (message, state) => {
|
|
|
...message,
|
|
|
toUsername: message.to,
|
|
|
});
|
|
|
+ setupNotifications(1)
|
|
|
+ return
|
|
|
}
|
|
|
// 音频消息
|
|
|
if (message.contentType === MSG_TYPE.AUDIO) {
|
|
@@ -58,6 +61,8 @@ export const handleMessageHook = (message, state) => {
|
|
|
file: audioUrl,
|
|
|
toUsername: message.to,
|
|
|
});
|
|
|
+ setupNotifications(1)
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
// 图片
|
|
@@ -69,6 +74,8 @@ export const handleMessageHook = (message, state) => {
|
|
|
file: url,
|
|
|
toUsername: message.to,
|
|
|
});
|
|
|
+ setupNotifications(1)
|
|
|
+ return
|
|
|
}
|
|
|
// 音频在线:拨号
|
|
|
if (
|