From 2f8c65f9303e4faaccb5235c0450060f818fd1b1 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Fri, 17 Mar 2023 15:17:40 +0800 Subject: [PATCH] friend --- internal/rpc/friend/friend.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/rpc/friend/friend.go b/internal/rpc/friend/friend.go index 6d519a3d5..a44b949a4 100644 --- a/internal/rpc/friend/friend.go +++ b/internal/rpc/friend/friend.go @@ -2,6 +2,7 @@ package friend import ( "context" + "github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation" @@ -195,7 +196,12 @@ func (s *friendServer) GetPaginationFriendsApplyFrom(ctx context.Context, req *p if err := s.userCheck.Access(ctx, req.UserID); err != nil { return nil, err } - friendRequests, total, err := s.FriendDatabase.PageFriendRequestFromMe(ctx, req.UserID, req.Pagination.PageNumber, req.Pagination.ShowNumber) + var pageNumber, showNumber int32 + if req.Pagination != nil { + pageNumber = req.Pagination.PageNumber + showNumber = req.Pagination.ShowNumber + } + friendRequests, total, err := s.FriendDatabase.PageFriendRequestFromMe(ctx, req.UserID, pageNumber, showNumber) if err != nil { return nil, err }