wkw 1 month ago
parent
commit
01d8744a23
1 changed files with 7 additions and 7 deletions
  1. 7 7
      src/views/im/hook/messagesHook.js

+ 7 - 7
src/views/im/hook/messagesHook.js

@@ -214,7 +214,7 @@ export const handleMessageHook = async (payload, wsStore) => {
       wsStore.pushMessage({
         ...message,
         toUuid: message.to,
-        fromUuid: message.from,
+        fromUuid: msg && msg.fromUuid ? msg.fromUuid : message.from,
         align: 'left',
         content: `${(msg.fromUsername || '对方')}撤回了一条消息`,
         fromAvatar: message.avatar,
@@ -265,7 +265,7 @@ export const handleMessageHook = async (payload, wsStore) => {
       messageType: MsgType.MESSAGE_TYPE_GROUP,
       fromAvatar: message.avatar,
       toUuid: message.to,
-      fromUuid: message.from,
+      fromUuid: msg && msg.fromUuid ? msg.fromUuid : message.from,
     });
     notifications(wsStore);
     return;
@@ -285,7 +285,7 @@ export const handleMessageHook = async (payload, wsStore) => {
       ...message,
       align: sender.uuid != wsStore.toUserInfo.uuid?'right':'left',
       toUuid: message.to,
-      fromUuid: message.from,
+      fromUuid: msg && msg.fromUuid ? msg.fromUuid : message.from,
       content: message.contentType === Constant.REJECT_AUDIO_ONLINE || message.contentType === Constant.REJECT_VIDEO_ONLINE ? '[对方拒绝]' : '[通话结束]',
       sender,
       fromAvatar: message.avatar,
@@ -299,7 +299,7 @@ export const handleMessageHook = async (payload, wsStore) => {
     wsStore.pushMessage(formatMessageExt({
       ...message,
       toUuid: message.to,
-      fromUuid: message.from,
+      fromUuid: msg && msg.fromUuid ? msg.fromUuid : message.from,
       align: 'left',
       fromAvatar: message.avatar,
     }, msg));
@@ -319,7 +319,7 @@ export const handleMessageHook = async (payload, wsStore) => {
       ...message,
       file: audioUrl,
       toUuid: message.to,
-      fromUuid: message.from,
+      fromUuid: msg && msg.fromUuid ? msg.fromUuid : message.from,
       align: 'left',
       fromAvatar: message.avatar,
     }, msg));
@@ -336,7 +336,7 @@ export const handleMessageHook = async (payload, wsStore) => {
       ...message,
       file: url,
       toUuid: message.to,
-      fromUuid: message.from,
+      fromUuid: msg && msg.fromUuid ? msg.fromUuid : message.from,
       align: 'left',
       fromAvatar: message.avatar,
     }, msg));
@@ -353,7 +353,7 @@ export const handleMessageHook = async (payload, wsStore) => {
       ...message,
       file: url,
       toUuid: message.to,
-      fromUuid: message.from,
+      fromUuid: msg && msg.fromUuid ? msg.fromUuid : message.from,
       align: 'left',
       fromAvatar: message.avatar,
     }, msg));