MCPcopy
hub / github.com/openimsdk/open-im-server / getUser

Method getUser

internal/rpc/group/notification.go:120–134  ·  view source on GitHub ↗
(ctx context.Context, userID string)

Source from the content-addressed store, hash-verified

118}
119
120func (g *NotificationSender) getUser(ctx context.Context, userID string) (*sdkws.PublicUserInfo, error) {
121 users, err := g.getUsersInfo(ctx, []string{userID})
122 if err != nil {
123 return nil, err
124 }
125 if len(users) == 0 {
126 return nil, servererrs.ErrUserIDNotFound.WrapMsg(fmt.Sprintf("user %s not found", userID))
127 }
128 return &sdkws.PublicUserInfo{
129 UserID: users[0].GetUserID(),
130 Nickname: users[0].GetNickname(),
131 FaceURL: users[0].GetFaceURL(),
132 Ex: users[0].GetEx(),
133 }, nil
134}
135
136func (g *NotificationSender) getGroupInfo(ctx context.Context, groupID string) (*sdkws.GroupInfo, error) {
137 gm, err := g.db.TakeGroup(ctx, groupID)

Callers 2

fillUserByUserIDMethod · 0.95

Calls 4

GetUserIDMethod · 0.65
GetNicknameMethod · 0.65
GetFaceURLMethod · 0.65
GetExMethod · 0.65

Tested by

no test coverage detected