|
@@ -213,8 +213,8 @@ export const handleMessageHook = async (payload, wsStore) => {
|
|
|
else {
|
|
|
wsStore.pushMessage({
|
|
|
...message,
|
|
|
- toUuid: message.to,
|
|
|
- fromUuid: message.from,
|
|
|
+ toUuid: wsStore.toUserInfo.type == 'user' ? message.to : message.from,
|
|
|
+ fromUuid: wsStore.toUserInfo.type == 'user' ? message.from : message.to,
|
|
|
fromUuids: msg?.fromUuid,
|
|
|
align: 'left',
|
|
|
content: `${(msg.fromUsername || '对方')}撤回了一条消息`,
|
|
@@ -265,8 +265,8 @@ export const handleMessageHook = async (payload, wsStore) => {
|
|
|
contentType,
|
|
|
messageType: MsgType.MESSAGE_TYPE_GROUP,
|
|
|
fromAvatar: message.avatar,
|
|
|
- toUuid: message.to,
|
|
|
- fromUuid: message.from,
|
|
|
+ toUuid: wsStore.toUserInfo.type == 'user' ? message.to : message.from,
|
|
|
+ fromUuid: wsStore.toUserInfo.type == 'user' ? message.from : message.to,
|
|
|
fromUuids: msg?.fromUuid,
|
|
|
});
|
|
|
notifications(wsStore);
|
|
@@ -286,8 +286,8 @@ export const handleMessageHook = async (payload, wsStore) => {
|
|
|
wsStore.pushMessage({
|
|
|
...message,
|
|
|
align: sender.uuid != wsStore.toUserInfo.uuid?'right':'left',
|
|
|
- toUuid: message.to,
|
|
|
- fromUuid: message.from,
|
|
|
+ toUuid: wsStore.toUserInfo.type == 'user' ? message.to : message.from,
|
|
|
+ fromUuid: wsStore.toUserInfo.type == 'user' ? message.from : message.to,
|
|
|
fromUuids: msg?.fromUuid,
|
|
|
content: message.contentType === Constant.REJECT_AUDIO_ONLINE || message.contentType === Constant.REJECT_VIDEO_ONLINE ? '[对方拒绝]' : '[通话结束]',
|
|
|
sender,
|
|
@@ -301,8 +301,8 @@ export const handleMessageHook = async (payload, wsStore) => {
|
|
|
wsStore.systemReceiptMessage(message, msg)
|
|
|
wsStore.pushMessage(formatMessageExt({
|
|
|
...message,
|
|
|
- toUuid: message.to,
|
|
|
- fromUuid: message.from,
|
|
|
+ toUuid: wsStore.toUserInfo.type == 'user' ? message.to : message.from,
|
|
|
+ fromUuid: wsStore.toUserInfo.type == 'user' ? message.from : message.to,
|
|
|
fromUuids: msg?.fromUuid,
|
|
|
align: 'left',
|
|
|
fromAvatar: message.avatar,
|
|
@@ -322,8 +322,8 @@ export const handleMessageHook = async (payload, wsStore) => {
|
|
|
wsStore.pushMessage(formatMessageExt({
|
|
|
...message,
|
|
|
file: audioUrl,
|
|
|
- toUuid: message.to,
|
|
|
- fromUuid: message.from,
|
|
|
+ toUuid: wsStore.toUserInfo.type == 'user' ? message.to : message.from,
|
|
|
+ fromUuid: wsStore.toUserInfo.type == 'user' ? message.from : message.to,
|
|
|
fromUuids: msg?.fromUuid,
|
|
|
align: 'left',
|
|
|
fromAvatar: message.avatar,
|
|
@@ -340,8 +340,8 @@ export const handleMessageHook = async (payload, wsStore) => {
|
|
|
wsStore.pushMessage(formatMessageExt({
|
|
|
...message,
|
|
|
file: url,
|
|
|
- toUuid: message.to,
|
|
|
- fromUuid: message.from,
|
|
|
+ toUuid: wsStore.toUserInfo.type == 'user' ? message.to : message.from,
|
|
|
+ fromUuid: wsStore.toUserInfo.type == 'user' ? message.from : message.to,
|
|
|
fromUuids: msg?.fromUuid,
|
|
|
align: 'left',
|
|
|
fromAvatar: message.avatar,
|
|
@@ -358,8 +358,8 @@ export const handleMessageHook = async (payload, wsStore) => {
|
|
|
wsStore.pushMessage(formatMessageExt({
|
|
|
...message,
|
|
|
file: url,
|
|
|
- toUuid: message.to,
|
|
|
- fromUuid: message.from,
|
|
|
+ toUuid: wsStore.toUserInfo.type == 'user' ? message.to : message.from,
|
|
|
+ fromUuid: wsStore.toUserInfo.type == 'user' ? message.from : message.to,
|
|
|
fromUuids: msg?.fromUuid,
|
|
|
align: 'left',
|
|
|
fromAvatar: message.avatar,
|