From 6dd625c18d39a4e6cb91ff35b87b6a7f6001c21a Mon Sep 17 00:00:00 2001 From: Gordon <46924906+FGadvancer@users.noreply.github.com> Date: Fri, 15 Dec 2023 12:15:30 +0800 Subject: [PATCH] fix: online notifications do not push to herself. --- internal/rpc/msg/send.go | 20 ++++++++++---------- internal/rpc/msg/verify.go | 34 +++++++++++++++++----------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/internal/rpc/msg/send.go b/internal/rpc/msg/send.go index dd08292bde..a45676e544 100644 --- a/internal/rpc/msg/send.go +++ b/internal/rpc/msg/send.go @@ -149,16 +149,16 @@ func (m *msgServer) sendMsgSingleChat(ctx context.Context, req *pbmsg.SendMsgReq isSend := true isNotification := msgprocessor.IsNotificationByMsg(req.MsgData) if !isNotification { - isSend, err = m.modifyMessageByUserMessageReceiveOpt( - ctx, - req.MsgData.RecvID, - utils.GenConversationIDForSingle(req.MsgData.SendID, req.MsgData.RecvID), - constant.SingleChatType, - req, - ) - if err != nil { - return nil, err - } + //isSend, err = m.modifyMessageByUserMessageReceiveOpt( + // ctx, + // req.MsgData.RecvID, + // utils.GenConversationIDForSingle(req.MsgData.SendID, req.MsgData.RecvID), + // constant.SingleChatType, + // req, + //) + //if err != nil { + // return nil, err + //} } if !isSend { prommetrics.SingleChatMsgProcessFailedCounter.Inc() diff --git a/internal/rpc/msg/verify.go b/internal/rpc/msg/verify.go index 2837cb944c..ebc2701389 100644 --- a/internal/rpc/msg/verify.go +++ b/internal/rpc/msg/verify.go @@ -58,23 +58,23 @@ func (m *msgServer) messageVerification(ctx context.Context, data *msg.SendMsgRe data.MsgData.ContentType >= constant.NotificationBegin { return nil } - black, err := m.friend.IsBlocked(ctx, data.MsgData.SendID, data.MsgData.RecvID) - if err != nil { - return err - } - if black { - return errs.ErrBlockedByPeer.Wrap() - } - if *config.Config.MessageVerify.FriendVerify { - friend, err := m.friend.IsFriend(ctx, data.MsgData.SendID, data.MsgData.RecvID) - if err != nil { - return err - } - if !friend { - return errs.ErrNotPeersFriend.Wrap() - } - return nil - } + //black, err := m.friend.IsBlocked(ctx, data.MsgData.SendID, data.MsgData.RecvID) + //if err != nil { + // return err + //} + //if black { + // return errs.ErrBlockedByPeer.Wrap() + //} + //if *config.Config.MessageVerify.FriendVerify { + // friend, err := m.friend.IsFriend(ctx, data.MsgData.SendID, data.MsgData.RecvID) + // if err != nil { + // return err + // } + // if !friend { + // return errs.ErrNotPeersFriend.Wrap() + // } + // return nil + //} return nil case constant.SuperGroupChatType: groupInfo, err := m.Group.GetGroupInfoCache(ctx, data.MsgData.GroupID)