mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-25 12:40:36 +00:00

git-subtree-dir: submodules/TelegramUI git-subtree-mainline: 5c1613d1048026b9e00a6ce753775cef87eb53fa git-subtree-split: fa3ac0b61a27c8dd3296518a15891a6f9750cbf2
22 lines
728 B
Swift
22 lines
728 B
Swift
import Foundation
|
|
import UIKit
|
|
import Display
|
|
import Postbox
|
|
import SwiftSignalKit
|
|
import TelegramCore
|
|
|
|
func peerInfoController(context: AccountContext, peer: Peer) -> ViewController? {
|
|
if let _ = peer as? TelegramGroup {
|
|
return groupInfoController(context: context, peerId: peer.id)
|
|
} else if let channel = peer as? TelegramChannel {
|
|
if case .group = channel.info {
|
|
return groupInfoController(context: context, peerId: peer.id)
|
|
} else {
|
|
return channelInfoController(context: context, peerId: peer.id)
|
|
}
|
|
} else if peer is TelegramUser || peer is TelegramSecretChat {
|
|
return userInfoController(context: context, peerId: peer.id)
|
|
}
|
|
return nil
|
|
}
|