@@ -198,22 +198,6 @@ func (s *Service) RequestFeature(ctx context.Context, user models.PublicUser, te
198198 return err
199199}
200200
201- // GetFollowersByUserId_old retrieves users that are following the specified user.
202- // Deprecated in favor of updated cursor based pagination in
203- func (s * Service ) GetFollowersByUserId_old (ctx context.Context , currentUser models.PublicUser , userId int , offset int , limit int ) ([]models.DetailedUser , error ) {
204- followers , err := s .store .GetFollowersByUserId_old (ctx , userId , limit , offset )
205- if err != nil {
206- return nil , err
207- }
208-
209- userIDs := make ([]int , len (followers ))
210- for i , follower := range followers {
211- userIDs [i ] = follower .UserID
212- }
213-
214- return s .fetchDetailedUsersFromIDs (ctx , currentUser .UserID , userIDs )
215- }
216-
217201func (s * Service ) GetFollowingByUserId (ctx context.Context , user models.PublicUser , targetUserId int , limit int , before * time.Time ) (* models.PaginatedUserList , error ) {
218202 userIDs , cursor , err := s .store .GetFollowingUserIds (ctx , targetUserId , limit , before )
219203 if err != nil {
@@ -228,39 +212,6 @@ func (s *Service) GetFollowingByUserId(ctx context.Context, user models.PublicUs
228212 return & models.PaginatedUserList {Users : users , NextCursor : cursor }, nil
229213}
230214
231- // GetFollowingByUserId retrieves users that the specified user is following.
232- // Deprecated Use GetFollowingByUserId instead
233- func (s * Service ) GetFollowingByUserId_old (ctx context.Context , currentUser models.PublicUser , userId int , offset int , limit int ) ([]models.DetailedUser , error ) {
234- following , err := s .store .GetFollowingByUserId_old (ctx , userId , limit , offset )
235- if err != nil {
236- return nil , err
237- }
238-
239- userIDs := make ([]int , len (following ))
240- for i , follow := range following {
241- userIDs [i ] = follow .UserID
242- }
243-
244- return s .fetchDetailedUsersFromIDs (ctx , currentUser .UserID , userIDs )
245- }
246-
247- // GetMutualsByUserId_old retrieves users that both the current user and the target user follow.
248- //
249- // Deprecated: prefer GetMutualsByUserId
250- func (s * Service ) GetMutualsByUserId_old (ctx context.Context , currentUser models.PublicUser , userId int , offset int , limit int ) ([]models.DetailedUser , error ) {
251- mutuals , err := s .store .GetMutualsByUserId_old (ctx , currentUser .UserID , userId , limit , offset )
252- if err != nil {
253- return nil , err
254- }
255-
256- userIDs := make ([]int , len (mutuals ))
257- for i , mutual := range mutuals {
258- userIDs [i ] = mutual .UserID
259- }
260-
261- return s .fetchDetailedUsersFromIDs (ctx , currentUser .UserID , userIDs )
262- }
263-
264215// GetMutualsByUserId returns users who are 'mutuals' with the current user and target user. That is, who follow both the current user and target user.
265216func (s * Service ) GetMutualsByUserId (ctx context.Context , user models.PublicUser , targetUserId int , limit int , before * time.Time ) (* models.PaginatedUserList , error ) {
266217 userIDs , cursor , err := s .store .GetMutualUserIds (ctx , user .UserID , targetUserId , limit , before )
0 commit comments