Implement forward and copy restriction

This commit is contained in:
Ilya Laktyushin
2021-11-03 13:35:57 +04:00
parent 7b3d1c6f59
commit 003d263ebd
6 changed files with 89 additions and 62 deletions

View File

@@ -238,6 +238,14 @@ public extension Message {
return false
}
}
func isCopyProtected() -> Bool {
if let channel = self.peers[self.id.peerId] as? TelegramChannel, case let .broadcast(flags) = channel.info, flags.flags.contains(.copyProtectionEnabled) && channel.adminRights == nil {
return true
} else {
return false
}
}
}
public extension Message {