mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Merge branch 'macos-9.4-1-release'
# Conflicts: # Telegram/Telegram-iOS/en.lproj/Localizable.strings # submodules/MediaPickerUI/Sources/MediaPickerScreen.swift # submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift # submodules/TelegramUI/Sources/OpenUrl.swift # submodules/UrlHandling/Sources/UrlHandling.swift
This commit is contained in:
commit
1ac77d526c
@ -1 +1 @@
|
|||||||
44eed22b384449bcec8962f2fddbfebd
|
3a64b94cc76109006731756f85403c85
|
||||||
|
@ -235,7 +235,7 @@ public final class MediaPickerScreen: ViewController, AttachmentContainable {
|
|||||||
self.scrollingArea = SparseItemGridScrollingArea()
|
self.scrollingArea = SparseItemGridScrollingArea()
|
||||||
|
|
||||||
self.cameraActivateAreaNode = AccessibilityAreaNode()
|
self.cameraActivateAreaNode = AccessibilityAreaNode()
|
||||||
self.cameraActivateAreaNode.accessibilityLabel = self.presentationData.strings.MediaPicker_VoiceOver_Camera
|
self.cameraActivateAreaNode.accessibilityLabel = "Camera"
|
||||||
self.cameraActivateAreaNode.accessibilityTraits = [.button]
|
self.cameraActivateAreaNode.accessibilityTraits = [.button]
|
||||||
|
|
||||||
super.init()
|
super.init()
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
|
|
||||||
@property (nonatomic) int32_t apiId;
|
@property (nonatomic) int32_t apiId;
|
||||||
@property (nonatomic, strong, readonly) NSString * _Nullable deviceModel;
|
@property (nonatomic, strong, readonly) NSString * _Nullable deviceModel;
|
||||||
@property (nonatomic, strong, readonly) NSDictionary<NSString *, NSString *> * _Nullable resolvedDeviceName;
|
@property (nonatomic, strong, readonly) NSString * _Nullable deviceModelName;
|
||||||
|
|
||||||
@property (nonatomic, strong, readonly) NSString * _Nullable systemVersion;
|
@property (nonatomic, strong, readonly) NSString * _Nullable systemVersion;
|
||||||
@property (nonatomic, strong) NSString * _Nullable appVersion;
|
@property (nonatomic, strong) NSString * _Nullable appVersion;
|
||||||
@ -83,6 +83,6 @@
|
|||||||
- (MTApiEnvironment * _Nonnull)withUpdatedNetworkSettings:(MTNetworkSettings * _Nullable)networkSettings;
|
- (MTApiEnvironment * _Nonnull)withUpdatedNetworkSettings:(MTNetworkSettings * _Nullable)networkSettings;
|
||||||
- (MTApiEnvironment * _Nonnull)withUpdatedSystemCode:(NSData * _Nullable)systemCode;
|
- (MTApiEnvironment * _Nonnull)withUpdatedSystemCode:(NSData * _Nullable)systemCode;
|
||||||
|
|
||||||
-(id _Nonnull)initWithResolvedDeviceName:(NSDictionary<NSString *, NSString *> * _Nullable)resolvedDeviceName;
|
-(id _Nonnull)initWithDeviceModelName:(NSString * _Nullable)deviceModelName;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -428,7 +428,7 @@ static NSData *base64_decode(NSString *str) {
|
|||||||
@implementation MTApiEnvironment
|
@implementation MTApiEnvironment
|
||||||
|
|
||||||
-(instancetype)init {
|
-(instancetype)init {
|
||||||
self = [self initWithResolvedDeviceName:nil];
|
self = [self initWithDeviceModelName:nil];
|
||||||
if (self != nil)
|
if (self != nil)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -436,22 +436,16 @@ static NSData *base64_decode(NSString *str) {
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
-(id _Nonnull)initWithResolvedDeviceName:(NSDictionary<NSString *, NSString *> * _Nullable)resolvedDeviceName {
|
-(id _Nonnull)initWithDeviceModelName:(NSString * _Nullable)deviceModelName {
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (self != nil)
|
if (self != nil)
|
||||||
{
|
{
|
||||||
if (resolvedDeviceName != nil) {
|
if (deviceModelName != nil) {
|
||||||
NSString *model = [self platformString];
|
_deviceModel = deviceModelName;
|
||||||
NSString* resolved = resolvedDeviceName[model];
|
|
||||||
if (resolved != nil) {
|
|
||||||
_deviceModel = resolved;
|
|
||||||
} else {
|
|
||||||
_deviceModel = model;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
_deviceModel = [self platformString];
|
_deviceModel = [self platformString];
|
||||||
}
|
}
|
||||||
_resolvedDeviceName = resolvedDeviceName;
|
_deviceModelName = deviceModelName;
|
||||||
#if TARGET_OS_IPHONE
|
#if TARGET_OS_IPHONE
|
||||||
_systemVersion = [[UIDevice currentDevice] systemVersion];
|
_systemVersion = [[UIDevice currentDevice] systemVersion];
|
||||||
#else
|
#else
|
||||||
@ -803,7 +797,7 @@ NSString *suffix = @"";
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (MTApiEnvironment *)withUpdatedLangPackCode:(NSString *)langPackCode {
|
- (MTApiEnvironment *)withUpdatedLangPackCode:(NSString *)langPackCode {
|
||||||
MTApiEnvironment *result = [[MTApiEnvironment alloc] initWithResolvedDeviceName:_resolvedDeviceName];
|
MTApiEnvironment *result = [[MTApiEnvironment alloc] initWithDeviceModelName:_deviceModelName];
|
||||||
|
|
||||||
result.apiId = self.apiId;
|
result.apiId = self.apiId;
|
||||||
result.appVersion = self.appVersion;
|
result.appVersion = self.appVersion;
|
||||||
@ -827,7 +821,7 @@ NSString *suffix = @"";
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)copyWithZone:(NSZone *)__unused zone {
|
- (instancetype)copyWithZone:(NSZone *)__unused zone {
|
||||||
MTApiEnvironment *result = [[MTApiEnvironment alloc] initWithResolvedDeviceName:_resolvedDeviceName];
|
MTApiEnvironment *result = [[MTApiEnvironment alloc] initWithDeviceModelName:_deviceModelName];
|
||||||
|
|
||||||
result.apiId = self.apiId;
|
result.apiId = self.apiId;
|
||||||
result.appVersion = self.appVersion;
|
result.appVersion = self.appVersion;
|
||||||
@ -851,7 +845,7 @@ NSString *suffix = @"";
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (MTApiEnvironment *)withUpdatedSocksProxySettings:(MTSocksProxySettings *)socksProxySettings {
|
- (MTApiEnvironment *)withUpdatedSocksProxySettings:(MTSocksProxySettings *)socksProxySettings {
|
||||||
MTApiEnvironment *result = [[MTApiEnvironment alloc] initWithResolvedDeviceName:_resolvedDeviceName];
|
MTApiEnvironment *result = [[MTApiEnvironment alloc] initWithDeviceModelName:_deviceModelName];
|
||||||
|
|
||||||
result.apiId = self.apiId;
|
result.apiId = self.apiId;
|
||||||
result.appVersion = self.appVersion;
|
result.appVersion = self.appVersion;
|
||||||
@ -875,7 +869,7 @@ NSString *suffix = @"";
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (MTApiEnvironment *)withUpdatedNetworkSettings:(MTNetworkSettings *)networkSettings {
|
- (MTApiEnvironment *)withUpdatedNetworkSettings:(MTNetworkSettings *)networkSettings {
|
||||||
MTApiEnvironment *result = [[MTApiEnvironment alloc] initWithResolvedDeviceName:_resolvedDeviceName];
|
MTApiEnvironment *result = [[MTApiEnvironment alloc] initWithDeviceModelName:_deviceModelName];
|
||||||
|
|
||||||
result.apiId = self.apiId;
|
result.apiId = self.apiId;
|
||||||
result.appVersion = self.appVersion;
|
result.appVersion = self.appVersion;
|
||||||
@ -899,7 +893,7 @@ NSString *suffix = @"";
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (MTApiEnvironment *)withUpdatedSystemCode:(NSData *)systemCode {
|
- (MTApiEnvironment *)withUpdatedSystemCode:(NSData *)systemCode {
|
||||||
MTApiEnvironment *result = [[MTApiEnvironment alloc] initWithResolvedDeviceName:_resolvedDeviceName];
|
MTApiEnvironment *result = [[MTApiEnvironment alloc] initWithDeviceModelName:_deviceModelName];
|
||||||
|
|
||||||
result.apiId = self.apiId;
|
result.apiId = self.apiId;
|
||||||
result.appVersion = self.appVersion;
|
result.appVersion = self.appVersion;
|
||||||
|
@ -68,6 +68,7 @@
|
|||||||
@[@"492960", @"492960", @13, @(STPCardBrandVisa)],
|
@[@"492960", @"492960", @13, @(STPCardBrandVisa)],
|
||||||
@[@"8600", @"8600", @16, @(STPCardBrandOther)],
|
@[@"8600", @"8600", @16, @(STPCardBrandOther)],
|
||||||
@[@"9860", @"9860", @16, @(STPCardBrandOther)],
|
@[@"9860", @"9860", @16, @(STPCardBrandOther)],
|
||||||
|
@[@"2", @"2", @16, @(STPCardBrandUnknown)],
|
||||||
];
|
];
|
||||||
NSMutableArray *binRanges = [NSMutableArray array];
|
NSMutableArray *binRanges = [NSMutableArray array];
|
||||||
for (NSArray *range in ranges) {
|
for (NSArray *range in ranges) {
|
||||||
|
@ -153,13 +153,14 @@ static NSString * _Nonnull stringByRemovingCharactersFromSet(NSString * _Nonnull
|
|||||||
return STPCardValidationStateIncomplete;
|
return STPCardValidationStateIncomplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL isValidLuhn = [self stringIsValidLuhn:sanitizedNumber];
|
//BOOL isValidLuhn = [self stringIsValidLuhn:sanitizedNumber];
|
||||||
return isValidLuhn ? STPCardValidationStateValid : STPCardValidationStateInvalid;
|
//return isValidLuhn ? STPCardValidationStateValid : STPCardValidationStateInvalid;
|
||||||
|
|
||||||
/*STPBINRange *binRange = [STPBINRange mostSpecificBINRangeForNumber:sanitizedNumber];
|
STPBINRange *binRange = [STPBINRange mostSpecificBINRangeForNumber:sanitizedNumber];
|
||||||
if (binRange.brand == STPCardBrandUnknown && validatingCardBrand) {
|
if (binRange.brand == STPCardBrandUnknown && validatingCardBrand) {
|
||||||
return STPCardValidationStateInvalid;
|
//return STPCardValidationStateInvalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sanitizedNumber.length == binRange.length) {
|
if (sanitizedNumber.length == binRange.length) {
|
||||||
BOOL isValidLuhn = [self stringIsValidLuhn:sanitizedNumber];
|
BOOL isValidLuhn = [self stringIsValidLuhn:sanitizedNumber];
|
||||||
return isValidLuhn ? STPCardValidationStateValid : STPCardValidationStateInvalid;
|
return isValidLuhn ? STPCardValidationStateValid : STPCardValidationStateInvalid;
|
||||||
@ -167,7 +168,7 @@ static NSString * _Nonnull stringByRemovingCharactersFromSet(NSString * _Nonnull
|
|||||||
return STPCardValidationStateInvalid;
|
return STPCardValidationStateInvalid;
|
||||||
} else {
|
} else {
|
||||||
return STPCardValidationStateIncomplete;
|
return STPCardValidationStateIncomplete;
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (STPCardValidationState)validationStateForCard:(nonnull STPCardParams *)card inCurrentYear:(NSInteger)currentYear currentMonth:(NSInteger)currentMonth {
|
+ (STPCardValidationState)validationStateForCard:(nonnull STPCardParams *)card inCurrentYear:(NSInteger)currentYear currentMonth:(NSInteger)currentMonth {
|
||||||
|
@ -432,8 +432,8 @@ public struct NetworkInitializationArguments {
|
|||||||
public let appData: Signal<Data?, NoError>
|
public let appData: Signal<Data?, NoError>
|
||||||
public let autolockDeadine: Signal<Int32?, NoError>
|
public let autolockDeadine: Signal<Int32?, NoError>
|
||||||
public let encryptionProvider: EncryptionProvider
|
public let encryptionProvider: EncryptionProvider
|
||||||
public let resolvedDeviceName:[String: String]?
|
public let deviceModelName:String?
|
||||||
public init(apiId: Int32, apiHash: String, languagesCategory: String, appVersion: String, voipMaxLayer: Int32, voipVersions: [CallSessionManagerImplementationVersion], appData: Signal<Data?, NoError>, autolockDeadine: Signal<Int32?, NoError>, encryptionProvider: EncryptionProvider, resolvedDeviceName:[String: String]?) {
|
public init(apiId: Int32, apiHash: String, languagesCategory: String, appVersion: String, voipMaxLayer: Int32, voipVersions: [CallSessionManagerImplementationVersion], appData: Signal<Data?, NoError>, autolockDeadine: Signal<Int32?, NoError>, encryptionProvider: EncryptionProvider, deviceModelName:String?) {
|
||||||
self.apiId = apiId
|
self.apiId = apiId
|
||||||
self.apiHash = apiHash
|
self.apiHash = apiHash
|
||||||
self.languagesCategory = languagesCategory
|
self.languagesCategory = languagesCategory
|
||||||
@ -443,7 +443,7 @@ public struct NetworkInitializationArguments {
|
|||||||
self.appData = appData
|
self.appData = appData
|
||||||
self.autolockDeadine = autolockDeadine
|
self.autolockDeadine = autolockDeadine
|
||||||
self.encryptionProvider = encryptionProvider
|
self.encryptionProvider = encryptionProvider
|
||||||
self.resolvedDeviceName = resolvedDeviceName
|
self.deviceModelName = deviceModelName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
@ -458,7 +458,7 @@ func initializedNetwork(accountId: AccountRecordId, arguments: NetworkInitializa
|
|||||||
|
|
||||||
let serialization = Serialization()
|
let serialization = Serialization()
|
||||||
|
|
||||||
var apiEnvironment = MTApiEnvironment(resolvedDeviceName: arguments.resolvedDeviceName)
|
var apiEnvironment = MTApiEnvironment(deviceModelName: arguments.deviceModelName)
|
||||||
|
|
||||||
apiEnvironment.apiId = arguments.apiId
|
apiEnvironment.apiId = arguments.apiId
|
||||||
apiEnvironment.langPack = arguments.languagesCategory
|
apiEnvironment.langPack = arguments.languagesCategory
|
||||||
|
@ -370,7 +370,7 @@ func applyUpdateGroupMessages(postbox: Postbox, stateManager: AccountStateManage
|
|||||||
mapping.append((message, MessageIndex(id: id, timestamp: storeMessage.timestamp), storeMessage))
|
mapping.append((message, MessageIndex(id: id, timestamp: storeMessage.timestamp), storeMessage))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
assertionFailure()
|
// assertionFailure()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
assertionFailure()
|
assertionFailure()
|
||||||
|
@ -141,7 +141,7 @@ public extension Peer {
|
|||||||
var isDeleted: Bool {
|
var isDeleted: Bool {
|
||||||
switch self {
|
switch self {
|
||||||
case let user as TelegramUser:
|
case let user as TelegramUser:
|
||||||
return user.firstName == nil && user.lastName == nil && user.phone == nil
|
return user.firstName == nil && user.lastName == nil
|
||||||
default:
|
default:
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit d114d7a3fc8adb894464a167521cbe871ba8c888
|
Subproject commit b0f186935c88e09be2106c80b9880ba92fb6b2d3
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"app": "9.4.2",
|
"app": "9.5",
|
||||||
"bazel": "5.3.1",
|
"bazel": "5.3.1",
|
||||||
"xcode": "14.2"
|
"xcode": "14.2"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user