|
|
@@ -153,6 +153,15 @@ func (*friendService) AgreeAddFriend(ctx context.Context, userId, friendId int64 |
|
|
|
|
|
|
|
// SendToFriend 消息发送至好友 |
|
|
|
func (*friendService) SendToFriend(ctx context.Context, sender *pb.Sender, req *pb.SendMessageReq) (int64, error) { |
|
|
|
//TODO::判断是否为好友 |
|
|
|
friend, err := FriendRepo.Get(sender.SenderId, req.ReceiverId) |
|
|
|
if err != nil { |
|
|
|
return 0, err |
|
|
|
} |
|
|
|
if friend == nil || friend.Status != FriendStatusAgree { |
|
|
|
return 0, gerrors.ErrNotIsFriend |
|
|
|
} |
|
|
|
|
|
|
|
// 发给发送者 |
|
|
|
seq, err := proxy.MessageProxy.SendToUser(ctx, sender, sender.SenderId, req) |
|
|
|
if err != nil { |
|
|
|