mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-03 02:42:19 +08:00
debug
This commit is contained in:
parent
27594a0ece
commit
d34e2054d5
2
go.mod
2
go.mod
@ -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…
x
Reference in New Issue
Block a user