diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Block.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Block.swift index c53428fbb..62d4b435c 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Block.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Block.swift @@ -26,12 +26,12 @@ extension APIService { public func getBlocked( authenticationBox: MastodonAuthenticationBox ) async throws -> Mastodon.Response.Content<[Mastodon.Entity.Account]> { - try await _getBlocked(sinceID: nil, limit: 40, authenticationBox: authenticationBox) + try await _getBlocked(sinceID: nil, limit: nil, authenticationBox: authenticationBox) } private func _getBlocked( sinceID: Mastodon.Entity.Status.ID?, - limit: Int, + limit: Int?, authenticationBox: MastodonAuthenticationBox ) async throws -> Mastodon.Response.Content<[Mastodon.Entity.Account]> { let managedObjectContext = backgroundManagedObjectContext @@ -57,13 +57,8 @@ extension APIService { managedObjectContext.delete(account) } } - - /// only try to paginate if retrieved userIDs count is larger than the set limit and if we get a prev linkId that's different than the currently used one - guard userIDs.count == limit, let prevSinceId = response.link?.linkIDs[.linkPrev]?.sinceId, sinceID != prevSinceId else { - return response - } - - return try await _getBlocked(sinceID: prevSinceId, limit: limit, authenticationBox: authenticationBox) + + return response } public func toggleBlock( diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Mute.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Mute.swift index 42178d573..f32b78841 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Mute.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Mute.swift @@ -25,12 +25,12 @@ extension APIService { public func getMutes( authenticationBox: MastodonAuthenticationBox ) async throws -> Mastodon.Response.Content<[Mastodon.Entity.Account]> { - try await _getMutes(sinceID: nil, limit: 40, authenticationBox: authenticationBox) + try await _getMutes(sinceID: nil, limit: nil, authenticationBox: authenticationBox) } private func _getMutes( sinceID: Mastodon.Entity.Status.ID?, - limit: Int, + limit: Int?, authenticationBox: MastodonAuthenticationBox ) async throws -> Mastodon.Response.Content<[Mastodon.Entity.Account]> { let managedObjectContext = backgroundManagedObjectContext @@ -56,13 +56,8 @@ extension APIService { managedObjectContext.delete(account) } } - - /// only try to paginate if retrieved userIDs count is larger than the set limit and if we get a prev linkId that's different than the currently used one - guard userIDs.count == limit, let prevSinceId = response.link?.linkIDs[.linkPrev]?.sinceId, sinceID != prevSinceId else { - return response - } - - return try await _getMutes(sinceID: prevSinceId, limit: limit, authenticationBox: authenticationBox) + + return response } public func toggleMute( diff --git a/MastodonSDK/Sources/MastodonSDK/API/Mastodon+API+Account+Friendship.swift b/MastodonSDK/Sources/MastodonSDK/API/Mastodon+API+Account+Friendship.swift index e191c3200..278e6cd27 100644 --- a/MastodonSDK/Sources/MastodonSDK/API/Mastodon+API+Account+Friendship.swift +++ b/MastodonSDK/Sources/MastodonSDK/API/Mastodon+API+Account+Friendship.swift @@ -239,8 +239,8 @@ public extension Mastodon.API.Account { static func blocks( session: URLSession, domain: String, - sinceID: Mastodon.Entity.Status.ID? = nil, - limit: Int, + sinceID: Mastodon.Entity.Status.ID?, + limit: Int?, authorization: Mastodon.API.OAuth.Authorization ) -> AnyPublisher, Error> { let request = Mastodon.API.get(