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];