pull/1532/head
AndrewZuo01 2 years ago
parent 27594a0ece
commit d34e2054d5

@ -155,4 +155,4 @@ require (
gopkg.in/ini.v1 v1.67.0 // indirect
)
replace github.com/OpenIMSDK/protocol v0.0.31 => github.com/AndrewZuo01/protocol v0.0.0-20231208060936-18be05d57a18
replace github.com/OpenIMSDK/protocol v0.0.31 => github.com/AndrewZuo01/protocol v0.0.0-20231208073751-274bf5b7eba8

@ -16,7 +16,6 @@ package friend
import (
"context"
"github.com/OpenIMSDK/protocol/wrapperspb"
"github.com/OpenIMSDK/tools/tx"
"github.com/OpenIMSDK/protocol/sdkws"
@ -407,10 +406,7 @@ func (s *friendServer) GetSpecifiedFriendsInfo(ctx context.Context, req *pbfrien
}
var friendInfo *sdkws.FriendInfo
if friend := friendMap[userID]; friend != nil {
var isPinnedBool bool
if friend.IsPinned != nil {
isPinnedBool = *friend.IsPinned // ignoring error for simplicity
}
friendInfo = &sdkws.FriendInfo{
OwnerUserID: friend.OwnerUserID,
Remark: friend.Remark,
@ -418,7 +414,7 @@ func (s *friendServer) GetSpecifiedFriendsInfo(ctx context.Context, req *pbfrien
AddSource: friend.AddSource,
OperatorUserID: friend.OperatorUserID,
Ex: friend.Ex,
IsPinned: wrapperspb.Bool(isPinnedBool),
IsPinned: friend.IsPinned,
}
}
var blackInfo *sdkws.BlackInfo

@ -17,8 +17,6 @@ package convert
import (
"context"
"fmt"
"github.com/OpenIMSDK/protocol/wrapperspb"
"github.com/OpenIMSDK/protocol/sdkws"
"github.com/OpenIMSDK/tools/utils"
@ -76,11 +74,7 @@ func FriendsDB2Pb(
friendPb.FriendUser.FaceURL = users[friend.FriendUserID].FaceURL
friendPb.FriendUser.Ex = users[friend.FriendUserID].Ex
friendPb.CreateTime = friend.CreateTime.Unix()
if friend.IsPinned != nil {
friendPb.IsPinned = wrapperspb.Bool(*friend.IsPinned)
} else {
friendPb.IsPinned = nil
}
friendPb.IsPinned = friend.IsPinned
friendsPb = append(friendsPb, friendPb)
}
return friendsPb, nil

@ -30,7 +30,7 @@ type FriendModel struct {
AddSource int32 `bson:"add_source"`
OperatorUserID string `bson:"operator_user_id"`
Ex string `bson:"ex"`
IsPinned *bool `bson:"is_pinned"`
IsPinned bool `bson:"is_pinned"`
}
// FriendModelInterface defines the operations for managing friends in MongoDB.

Loading…
Cancel
Save