mirror of
https://github.com/GLEGram/GLEGram-iOS.git
synced 2026-04-23 19:36:26 +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.
33 lines
805 B
Swift
33 lines
805 B
Swift
import Foundation
|
|
import JSONUtilities
|
|
|
|
/// Describes an order of groups.
|
|
public struct GroupOrdering: Equatable {
|
|
|
|
/// A group name pattern.
|
|
public var pattern: String
|
|
|
|
/// A group name regex.
|
|
public var regex: NSRegularExpression?
|
|
|
|
/// Subgroups orders.
|
|
public var order: [String]
|
|
|
|
public init(pattern: String = "", order: [String] = []) {
|
|
self.pattern = pattern
|
|
self.regex = try? NSRegularExpression(pattern: pattern)
|
|
self.order = order
|
|
}
|
|
|
|
}
|
|
|
|
extension GroupOrdering: JSONObjectConvertible {
|
|
|
|
public init(jsonDictionary: JSONDictionary) throws {
|
|
pattern = jsonDictionary.json(atKeyPath: "pattern") ?? ""
|
|
regex = try? NSRegularExpression(pattern: pattern)
|
|
order = jsonDictionary.json(atKeyPath: "order") ?? []
|
|
}
|
|
|
|
}
|