mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Refactoring
This commit is contained in:
@@ -324,7 +324,7 @@ public func channelBlacklistController(context: AccountContext, peerId: PeerId)
|
||||
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
||||
let progress = OverlayStatusController(theme: presentationData.theme, type: .loading(cancelled: nil))
|
||||
presentControllerImpl?(progress, nil)
|
||||
removePeerDisposable.set((context.peerChannelMemberCategoriesContextsManager.updateMemberBannedRights(account: context.account, peerId: peerId, memberId: peer.id, bannedRights: TelegramChatBannedRights(flags: [.banReadMessages], untilDate: Int32.max))
|
||||
removePeerDisposable.set((context.peerChannelMemberCategoriesContextsManager.updateMemberBannedRights(engine: context.engine, peerId: peerId, memberId: peer.id, bannedRights: TelegramChatBannedRights(flags: [.banReadMessages], untilDate: Int32.max))
|
||||
|> deliverOnMainQueue).start(error: { [weak progress] _ in
|
||||
progress?.dismiss()
|
||||
dismissController?()
|
||||
@@ -343,7 +343,7 @@ public func channelBlacklistController(context: AccountContext, peerId: PeerId)
|
||||
return $0.withUpdatedRemovingPeerId(memberId)
|
||||
}
|
||||
|
||||
removePeerDisposable.set((context.peerChannelMemberCategoriesContextsManager.updateMemberBannedRights(account: context.account, peerId: peerId, memberId: memberId, bannedRights: nil) |> deliverOnMainQueue).start(error: { _ in
|
||||
removePeerDisposable.set((context.peerChannelMemberCategoriesContextsManager.updateMemberBannedRights(engine: context.engine, peerId: peerId, memberId: memberId, bannedRights: nil) |> deliverOnMainQueue).start(error: { _ in
|
||||
updateState {
|
||||
return $0.withUpdatedRemovingPeerId(nil)
|
||||
}
|
||||
@@ -388,7 +388,7 @@ public func channelBlacklistController(context: AccountContext, peerId: PeerId)
|
||||
updateState {
|
||||
return $0.withUpdatedRemovingPeerId(memberId)
|
||||
}
|
||||
let signal = context.peerChannelMemberCategoriesContextsManager.updateMemberBannedRights(account: context.account, peerId: peerId, memberId: memberId, bannedRights: nil)
|
||||
let signal = context.peerChannelMemberCategoriesContextsManager.updateMemberBannedRights(engine: context.engine, peerId: peerId, memberId: memberId, bannedRights: nil)
|
||||
|> ignoreValues
|
||||
|> then(
|
||||
context.peerChannelMemberCategoriesContextsManager.addMember(account: context.account, peerId: peerId, memberId: memberId)
|
||||
@@ -418,7 +418,7 @@ public func channelBlacklistController(context: AccountContext, peerId: PeerId)
|
||||
return $0.withUpdatedRemovingPeerId(memberId)
|
||||
}
|
||||
|
||||
removePeerDisposable.set((context.peerChannelMemberCategoriesContextsManager.updateMemberBannedRights(account: context.account, peerId: peerId, memberId: memberId, bannedRights: nil) |> deliverOnMainQueue).start(error: { _ in
|
||||
removePeerDisposable.set((context.peerChannelMemberCategoriesContextsManager.updateMemberBannedRights(engine: context.engine, peerId: peerId, memberId: memberId, bannedRights: nil) |> deliverOnMainQueue).start(error: { _ in
|
||||
updateState {
|
||||
return $0.withUpdatedRemovingPeerId(nil)
|
||||
}
|
||||
@@ -437,7 +437,7 @@ public func channelBlacklistController(context: AccountContext, peerId: PeerId)
|
||||
})
|
||||
})
|
||||
|
||||
let (listDisposable, loadMoreControl) = context.peerChannelMemberCategoriesContextsManager.banned(postbox: context.account.postbox, network: context.account.network, accountPeerId: context.account.peerId, peerId: peerId, updated: { listState in
|
||||
let (listDisposable, loadMoreControl) = context.peerChannelMemberCategoriesContextsManager.banned(engine: context.engine, postbox: context.account.postbox, network: context.account.network, accountPeerId: context.account.peerId, peerId: peerId, updated: { listState in
|
||||
if case .loading(true) = listState.loadingState, listState.list.isEmpty {
|
||||
blacklistPromise.set(.single(nil))
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user