mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Send as improvements
This commit is contained in:
@@ -284,6 +284,19 @@ extension ChatControllerImpl {
|
||||
if let channel = peerViewMainPeer(peerView) as? TelegramChannel, case .group = channel.info, channel.hasPermission(.canBeAnonymous) {
|
||||
allPeers = peers
|
||||
|
||||
var hasAnonymousPeer = false
|
||||
for peer in peers {
|
||||
if peer.peer.id == channel.id {
|
||||
hasAnonymousPeer = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !hasAnonymousPeer {
|
||||
allPeers?.insert(SendAsPeer(peer: channel, subscribers: 0, isPremiumRequired: false), at: 0)
|
||||
}
|
||||
} else if let channel = peerViewMainPeer(peerView) as? TelegramChannel, case let .broadcast(info) = channel.info, info.flags.contains(.messagesShouldHaveProfiles) {
|
||||
allPeers = peers
|
||||
|
||||
var hasAnonymousPeer = false
|
||||
for peer in peers {
|
||||
if peer.peer.id == channel.id {
|
||||
@@ -3978,6 +3991,8 @@ extension ChatControllerImpl {
|
||||
let defaultMyPeerId: PeerId
|
||||
if let channel = strongSelf.presentationInterfaceState.renderedPeer?.chatMainPeer as? TelegramChannel, case .group = channel.info, channel.hasPermission(.canBeAnonymous) {
|
||||
defaultMyPeerId = channel.id
|
||||
} else if let channel = strongSelf.presentationInterfaceState.renderedPeer?.chatMainPeer as? TelegramChannel, case let .broadcast(info) = channel.info, info.flags.contains(.messagesShouldHaveProfiles) {
|
||||
defaultMyPeerId = channel.id
|
||||
} else {
|
||||
defaultMyPeerId = strongSelf.context.account.peerId
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user