mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 11:23:48 +00:00
Expose discussion group in chats
This commit is contained in:
parent
d574500fdb
commit
c786c9904e
@ -2424,8 +2424,8 @@ func peerInfoHeaderButtons(peer: Peer?, cachedData: CachedPeerData?, isOpenedFro
|
||||
result.append(.message)
|
||||
}
|
||||
result.append(.mute)
|
||||
if case let .broadcast(info) = channel.info, info.flags.contains(.hasMonoforum), !channel.hasPermission(.manageDirect) {
|
||||
} else if hasDiscussion {
|
||||
/* /* MARK: Swiftgram */ if case let .broadcast(info) = channel.info, info.flags.contains(.hasMonoforum), !channel.hasPermission(.manageDirect) {
|
||||
} else*/ if hasDiscussion {
|
||||
result.append(.discussion)
|
||||
}
|
||||
result.append(.search)
|
||||
|
@ -25,6 +25,7 @@ enum PeerInfoHeaderButtonKey: Hashable {
|
||||
|
||||
enum PeerInfoHeaderButtonIcon {
|
||||
case message
|
||||
case discussion // MARK: Swiftgram
|
||||
case call
|
||||
case videoCall
|
||||
case voiceChat
|
||||
@ -155,6 +156,7 @@ final class PeerInfoHeaderButtonNode: HighlightableButtonNode {
|
||||
switch icon {
|
||||
case .message:
|
||||
imageName = "Peer Info/ButtonMessage"
|
||||
case .discussion: imageName = "Chat/Empty Chat/ChannelMessages" // MARK: Swiftgram
|
||||
case .call:
|
||||
imageName = "Peer Info/ButtonCall"
|
||||
case .videoCall:
|
||||
@ -176,7 +178,7 @@ final class PeerInfoHeaderButtonNode: HighlightableButtonNode {
|
||||
case .stop:
|
||||
imageName = "Peer Info/ButtonStop"
|
||||
}
|
||||
if let imageName = imageName, let image = generateTintedImage(image: UIImage(bundleImageName: imageName), color: .white) {
|
||||
if let imageName = imageName, let image = generateTintedImage(image: UIImage(bundleImageName: imageName), color: .white, customSize: icon == .discussion ? CGSize(width: 26.0, height: 26.0) : nil /* MARK: Swiftgram */) {
|
||||
let imageRect = CGRect(origin: CGPoint(x: floor((size.width - image.size.width) / 2.0), y: floor((size.height - image.size.height) / 2.0)), size: image.size)
|
||||
context.clip(to: imageRect, mask: image.cgImage!)
|
||||
context.fill(imageRect)
|
||||
|
@ -2383,7 +2383,7 @@ final class PeerInfoHeaderNode: ASDisplayNode {
|
||||
buttonIcon = .message
|
||||
case .discussion:
|
||||
buttonText = presentationData.strings.PeerInfo_ButtonDiscuss
|
||||
buttonIcon = .message
|
||||
buttonIcon = .discussion // MARK: Swiftgram
|
||||
case .call:
|
||||
buttonText = presentationData.strings.PeerInfo_ButtonCall
|
||||
buttonIcon = .call
|
||||
|
Loading…
x
Reference in New Issue
Block a user