mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
no message
This commit is contained in:
@@ -21,8 +21,8 @@ public enum ChannelMembersCategory {
|
||||
case banned(ChannelMembersCategoryFilter)
|
||||
}
|
||||
|
||||
public func channelMembers(postbox: Postbox, network: Network, peerId: PeerId, category: ChannelMembersCategory = .recent(.all), offset: Int32 = 0, limit: Int32 = 64) -> Signal<[RenderedChannelParticipant], NoError> {
|
||||
return postbox.modify { modifier -> Signal<[RenderedChannelParticipant], NoError> in
|
||||
public func channelMembers(postbox: Postbox, network: Network, peerId: PeerId, category: ChannelMembersCategory = .recent(.all), offset: Int32 = 0, limit: Int32 = 64, hash: Int32 = 0) -> Signal<[RenderedChannelParticipant]?, NoError> {
|
||||
return postbox.modify { modifier -> Signal<[RenderedChannelParticipant]?, NoError> in
|
||||
if let peer = modifier.getPeer(peerId), let inputChannel = apiInputChannel(peer) {
|
||||
let apiFilter: Api.ChannelParticipantsFilter
|
||||
switch category {
|
||||
@@ -50,10 +50,10 @@ public func channelMembers(postbox: Postbox, network: Network, peerId: PeerId, c
|
||||
apiFilter = .channelParticipantsKicked(q: query)
|
||||
}
|
||||
}
|
||||
return network.request(Api.functions.channels.getParticipants(channel: inputChannel, filter: apiFilter, offset: offset, limit: limit, hash: 0))
|
||||
return network.request(Api.functions.channels.getParticipants(channel: inputChannel, filter: apiFilter, offset: offset, limit: limit, hash: hash))
|
||||
|> retryRequest
|
||||
|> mapToSignal { result -> Signal<[RenderedChannelParticipant], NoError> in
|
||||
return postbox.modify { modifier -> [RenderedChannelParticipant] in
|
||||
|> mapToSignal { result -> Signal<[RenderedChannelParticipant]?, NoError> in
|
||||
return postbox.modify { modifier -> [RenderedChannelParticipant]? in
|
||||
var items: [RenderedChannelParticipant] = []
|
||||
switch result {
|
||||
case let .channelParticipants(_, participants, users):
|
||||
@@ -78,7 +78,7 @@ public func channelMembers(postbox: Postbox, network: Network, peerId: PeerId, c
|
||||
|
||||
}
|
||||
case .channelParticipantsNotModified:
|
||||
break
|
||||
return nil
|
||||
}
|
||||
return items
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user