#import @protocol MTMessageService; @class MTQueue; @class MTContext; @class MTNetworkUsageCalculationInfo; @class MTApiEnvironment; @class MTDatacenterAuthKey; @class MTProto; @interface MTProtoConnectionState : NSObject @property (nonatomic, readonly) bool isConnected; @property (nonatomic, readonly) NSString *proxyAddress; @property (nonatomic, readonly) bool proxyHasConnectionIssues; @end @protocol MTProtoDelegate @optional - (void)mtProtoNetworkAvailabilityChanged:(MTProto *)mtProto isNetworkAvailable:(bool)isNetworkAvailable; - (void)mtProtoConnectionStateChanged:(MTProto *)mtProto state:(MTProtoConnectionState *)state; - (void)mtProtoConnectionContextUpdateStateChanged:(MTProto *)mtProto isUpdatingConnectionContext:(bool)isUpdatingConnectionContext; - (void)mtProtoServiceTasksStateChanged:(MTProto *)mtProto isPerformingServiceTasks:(bool)isPerformingServiceTasks; @end @interface MTProto : NSObject @property (nonatomic, weak) id delegate; @property (nonatomic, strong, readonly) MTContext *context; @property (nonatomic, strong, readonly) MTApiEnvironment *apiEnvironment; @property (nonatomic) NSInteger datacenterId; @property (nonatomic) bool shouldStayConnected; @property (nonatomic) bool useUnauthorizedMode; @property (nonatomic) bool useTempAuthKeys; @property (nonatomic) bool media; @property (nonatomic) bool enforceMedia; @property (nonatomic) bool cdn; @property (nonatomic) bool checkForProxyConnectionIssues; @property (nonatomic) id requiredAuthToken; @property (nonatomic) NSInteger authTokenMasterDatacenterId; - (instancetype)initWithContext:(MTContext *)context datacenterId:(NSInteger)datacenterId usageCalculationInfo:(MTNetworkUsageCalculationInfo *)usageCalculationInfo; - (void)setUsageCalculationInfo:(MTNetworkUsageCalculationInfo *)usageCalculationInfo; - (void)pause; - (void)resume; - (void)stop; - (void)finalizeSession; - (void)addMessageService:(id)messageService; - (void)removeMessageService:(id)messageService; - (MTQueue *)messageServiceQueue; - (void)requestTransportTransaction; - (void)requestSecureTransportReset; - (void)resetSessionInfo; - (void)requestTimeResync; - (void)_messageResendRequestFailed:(int64_t)messageId; @end