mirror of
https://github.com/GLEGram/GLEGram-iOS.git
synced 2026-04-30 14:57:53 +02:00
4647310322
Based on Swiftgram 12.5 (Telegram iOS 12.5). All GLEGram features ported and organized in GLEGram/ folder. Features: Ghost Mode, Saved Deleted Messages, Content Protection Bypass, Font Replacement, Fake Profile, Chat Export, Plugin System, and more. See CHANGELOG_12.5.md for full details.
22 lines
744 B
Swift
22 lines
744 B
Swift
import Foundation
|
|
import Postbox
|
|
|
|
|
|
// Incuding at least one Objective-C class in a swift file ensures that it doesn't get stripped by the linker
|
|
private final class LinkHelperClass: NSObject {
|
|
}
|
|
|
|
public func canSendMessagesToPeer(_ peer: Peer, ignoreDefault: Bool = false) -> Bool {
|
|
if let peer = peer as? TelegramUser, peer.addressName == "replies" {
|
|
return false
|
|
} else if peer is TelegramUser || peer is TelegramGroup {
|
|
return !peer.isDeleted
|
|
} else if let peer = peer as? TelegramSecretChat {
|
|
return peer.embeddedState == .active
|
|
} else if let peer = peer as? TelegramChannel {
|
|
return peer.hasPermission(.sendSomething, ignoreDefault: ignoreDefault)
|
|
} else {
|
|
return false
|
|
}
|
|
}
|