(ctx context.Context, r createRoomRequest, device *api.Device, profileAPI api.ClientUserAPI)
| 168 | } |
| 169 | |
| 170 | func ValidateCreateRoomReq(ctx context.Context, r createRoomRequest, device *api.Device, profileAPI api.ClientUserAPI) error { |
| 171 | for _, invitee := range r.Invite { |
| 172 | autoJoin, err := profileAPI.JudgeShouldAutoJoin(ctx, device.UserID, invitee) |
| 173 | if err != nil || !autoJoin { |
| 174 | return errors.New("user " + invitee + " can not be invited") |
| 175 | } |
| 176 | } |
| 177 | return nil |
| 178 | } |
| 179 | |
| 180 | // createRoom implements /createRoom |
| 181 | // nolint: gocyclo |
no test coverage detected