-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1135 from anyproto/ios-2536-support-limits
iOS-2536 Spaces | support limits for participants
- Loading branch information
Showing
8 changed files
with
109 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
Modules/Services/Sources/Services/ParticipantService/ParticipantService.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import Foundation | ||
|
||
public protocol ParticipantServiceProtocol: AnyObject { | ||
func searchParticipants(spaceId: String) async throws -> [Participant] | ||
} | ||
|
||
final class ParticipantService: ParticipantServiceProtocol { | ||
|
||
@Injected(\.searchMiddleService) | ||
private var searchService: SearchMiddleServiceProtocol | ||
|
||
func searchParticipants(spaceId: String) async throws -> [Participant] { | ||
|
||
let filters: [DataviewFilter] = .builder { | ||
SearchHelper.spaceId(spaceId) | ||
SearchHelper.layoutFilter([.participant]) | ||
} | ||
|
||
let data = SearchRequest(filters: filters, sorts: [], fullText: "", keys: Participant.subscriptionKeys.map(\.rawValue), limit: 0) | ||
let details = try await searchService.search(data: data) | ||
return details.compactMap { try? Participant(details: $0) } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters