mirror of
https://github.com/GLEGram/GLEGram-iOS.git
synced 2026-04-24 11:56:18 +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.
31 lines
806 B
Swift
31 lines
806 B
Swift
import Foundation
|
|
import Postbox
|
|
|
|
|
|
public protocol SplitTestEvent: RawRepresentable where RawValue == String {
|
|
}
|
|
|
|
public protocol SplitTestConfiguration {
|
|
static var defaultValue: Self { get }
|
|
}
|
|
|
|
public protocol SplitTest {
|
|
associatedtype Configuration: SplitTestConfiguration
|
|
associatedtype Event: SplitTestEvent
|
|
|
|
var postbox: Postbox { get }
|
|
var bucket: String? { get }
|
|
var configuration: Configuration { get }
|
|
|
|
init(postbox: Postbox, bucket: String?, configuration: Configuration)
|
|
}
|
|
|
|
extension SplitTest {
|
|
public func addEvent(_ event: Self.Event, data: JSON = []) {
|
|
if let bucket = self.bucket {
|
|
//TODO: merge additional data
|
|
addAppLogEvent(postbox: self.postbox, type: event.rawValue, data: ["bucket": bucket])
|
|
}
|
|
}
|
|
}
|