From 5b3825cde26cae4ea2d7ba3603ecd3aa2563cdb0 Mon Sep 17 00:00:00 2001 From: overtake Date: Sat, 29 Jul 2017 02:19:16 +0300 Subject: [PATCH] copy mtapienvironment --- MTProtoKit/MTApiEnvironment.m | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/MTProtoKit/MTApiEnvironment.m b/MTProtoKit/MTApiEnvironment.m index 43bad91410..5f65b7b1e8 100644 --- a/MTProtoKit/MTApiEnvironment.m +++ b/MTProtoKit/MTApiEnvironment.m @@ -373,6 +373,22 @@ typedef enum { return result; } +-(id)copy { + MTApiEnvironment *result = [[MTApiEnvironment alloc] init]; + result.apiId = self.apiId; + result.appVersion = self.appVersion; + result.layer = self.layer; + result.langPack = self.langPack; + result->_langPackCode = self.langPackCode; + result.disableUpdates = self.disableUpdates; + result.tcpPayloadPrefix = self.tcpPayloadPrefix; + result.datacenterAddressOverrides = self.datacenterAddressOverrides; + result->_socksProxySettings = self.socksProxySettings; + [result _updateApiInitializationHash]; + return result; + +} + - (MTApiEnvironment *)withUpdatedSocksProxySettings:(MTSocksProxySettings *)socksProxySettings { MTApiEnvironment *result = [[MTApiEnvironment alloc] init];