mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Implement content restriction API
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import Foundation
|
||||
import TelegramCore
|
||||
import SyncCore
|
||||
import SyncCore
|
||||
|
||||
public extension RestrictedContentMessageAttribute {
|
||||
func platformText(platform: String) -> String? {
|
||||
func platformText(platform: String, contentSettings: ContentSettings) -> String? {
|
||||
for rule in self.rules {
|
||||
if rule.platform == "all" || rule.platform == "ios" {
|
||||
return rule.text
|
||||
if !contentSettings.ignoreContentRestrictionReasons.contains(rule.reason) {
|
||||
return rule.text
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user