(ctx context.Context, userID string)
| 118 | } |
| 119 | |
| 120 | func (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 | |
| 136 | func (g *NotificationSender) getGroupInfo(ctx context.Context, groupID string) (*sdkws.GroupInfo, error) { |
| 137 | gm, err := g.db.TakeGroup(ctx, groupID) |
no test coverage detected