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.cameraActivateAreaNode = AccessibilityAreaNode()
|
||||
self.cameraActivateAreaNode.accessibilityLabel = self.presentationData.strings.MediaPicker_VoiceOver_Camera
|
||||
self.cameraActivateAreaNode.accessibilityLabel = "Camera"
|
||||
self.cameraActivateAreaNode.accessibilityTraits = [.button]
|
||||
|
||||
super.init()
|
||||
|
@ -55,7 +55,7 @@
|
||||
|
||||
@property (nonatomic) int32_t apiId;
|
||||
@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) NSString * _Nullable appVersion;
|
||||
@ -83,6 +83,6 @@
|
||||
- (MTApiEnvironment * _Nonnull)withUpdatedNetworkSettings:(MTNetworkSettings * _Nullable)networkSettings;
|
||||
- (MTApiEnvironment * _Nonnull)withUpdatedSystemCode:(NSData * _Nullable)systemCode;
|
||||
|
||||
-(id _Nonnull)initWithResolvedDeviceName:(NSDictionary<NSString *, NSString *> * _Nullable)resolvedDeviceName;
|
||||
-(id _Nonnull)initWithDeviceModelName:(NSString * _Nullable)deviceModelName;
|
||||
|
||||
@end
|
||||
|
@ -428,7 +428,7 @@ static NSData *base64_decode(NSString *str) {
|
||||
@implementation MTApiEnvironment
|
||||
|
||||
-(instancetype)init {
|
||||
self = [self initWithResolvedDeviceName:nil];
|
||||
self = [self initWithDeviceModelName:nil];
|
||||
if (self != nil)
|
||||
{
|
||||
|
||||
@ -436,22 +436,16 @@ static NSData *base64_decode(NSString *str) {
|
||||
return self;
|
||||
}
|
||||
|
||||
-(id _Nonnull)initWithResolvedDeviceName:(NSDictionary<NSString *, NSString *> * _Nullable)resolvedDeviceName {
|
||||
-(id _Nonnull)initWithDeviceModelName:(NSString * _Nullable)deviceModelName {
|
||||
self = [super init];
|
||||
if (self != nil)
|
||||
{
|
||||
if (resolvedDeviceName != nil) {
|
||||
NSString *model = [self platformString];
|
||||
NSString* resolved = resolvedDeviceName[model];
|
||||
if (resolved != nil) {
|
||||
_deviceModel = resolved;
|
||||
} else {
|
||||
_deviceModel = model;
|
||||
}
|
||||
if (deviceModelName != nil) {
|
||||
_deviceModel = deviceModelName;
|
||||
} else {
|
||||
_deviceModel = [self platformString];
|
||||
}
|
||||
_resolvedDeviceName = resolvedDeviceName;
|
||||
_deviceModelName = deviceModelName;
|
||||
#if TARGET_OS_IPHONE
|
||||
_systemVersion = [[UIDevice currentDevice] systemVersion];
|
||||
#else
|
||||
@ -803,7 +797,7 @@ NSString *suffix = @"";
|
||||
}
|
||||
|
||||
- (MTApiEnvironment *)withUpdatedLangPackCode:(NSString *)langPackCode {
|
||||
MTApiEnvironment *result = [[MTApiEnvironment alloc] initWithResolvedDeviceName:_resolvedDeviceName];
|
||||
MTApiEnvironment *result = [[MTApiEnvironment alloc] initWithDeviceModelName:_deviceModelName];
|
||||
|
||||
result.apiId = self.apiId;
|
||||
result.appVersion = self.appVersion;
|
||||
@ -827,7 +821,7 @@ NSString *suffix = @"";
|
||||
}
|
||||
|
||||
- (instancetype)copyWithZone:(NSZone *)__unused zone {
|
||||
MTApiEnvironment *result = [[MTApiEnvironment alloc] initWithResolvedDeviceName:_resolvedDeviceName];
|
||||
MTApiEnvironment *result = [[MTApiEnvironment alloc] initWithDeviceModelName:_deviceModelName];
|
||||
|
||||
result.apiId = self.apiId;
|
||||
result.appVersion = self.appVersion;
|
||||
@ -851,7 +845,7 @@ NSString *suffix = @"";
|
||||
}
|
||||
|
||||
- (MTApiEnvironment *)withUpdatedSocksProxySettings:(MTSocksProxySettings *)socksProxySettings {
|
||||
MTApiEnvironment *result = [[MTApiEnvironment alloc] initWithResolvedDeviceName:_resolvedDeviceName];
|
||||
MTApiEnvironment *result = [[MTApiEnvironment alloc] initWithDeviceModelName:_deviceModelName];
|
||||
|
||||
result.apiId = self.apiId;
|
||||
result.appVersion = self.appVersion;
|
||||
@ -875,7 +869,7 @@ NSString *suffix = @"";
|
||||
}
|
||||
|
||||
- (MTApiEnvironment *)withUpdatedNetworkSettings:(MTNetworkSettings *)networkSettings {
|
||||
MTApiEnvironment *result = [[MTApiEnvironment alloc] initWithResolvedDeviceName:_resolvedDeviceName];
|
||||
MTApiEnvironment *result = [[MTApiEnvironment alloc] initWithDeviceModelName:_deviceModelName];
|
||||
|
||||
result.apiId = self.apiId;
|
||||
result.appVersion = self.appVersion;
|
||||
@ -899,7 +893,7 @@ NSString *suffix = @"";
|
||||
}
|
||||
|
||||
- (MTApiEnvironment *)withUpdatedSystemCode:(NSData *)systemCode {
|
||||
MTApiEnvironment *result = [[MTApiEnvironment alloc] initWithResolvedDeviceName:_resolvedDeviceName];
|
||||
MTApiEnvironment *result = [[MTApiEnvironment alloc] initWithDeviceModelName:_deviceModelName];
|
||||
|
||||
result.apiId = self.apiId;
|
||||
result.appVersion = self.appVersion;
|
||||
|
@ -68,6 +68,7 @@
|
||||
@[@"492960", @"492960", @13, @(STPCardBrandVisa)],
|
||||
@[@"8600", @"8600", @16, @(STPCardBrandOther)],
|
||||
@[@"9860", @"9860", @16, @(STPCardBrandOther)],
|
||||
@[@"2", @"2", @16, @(STPCardBrandUnknown)],
|
||||
];
|
||||
NSMutableArray *binRanges = [NSMutableArray array];
|
||||
for (NSArray *range in ranges) {
|
||||
|
@ -153,13 +153,14 @@ static NSString * _Nonnull stringByRemovingCharactersFromSet(NSString * _Nonnull
|
||||
return STPCardValidationStateIncomplete;
|
||||
}
|
||||
|
||||
BOOL isValidLuhn = [self stringIsValidLuhn:sanitizedNumber];
|
||||
return isValidLuhn ? STPCardValidationStateValid : STPCardValidationStateInvalid;
|
||||
//BOOL isValidLuhn = [self stringIsValidLuhn:sanitizedNumber];
|
||||
//return isValidLuhn ? STPCardValidationStateValid : STPCardValidationStateInvalid;
|
||||
|
||||
/*STPBINRange *binRange = [STPBINRange mostSpecificBINRangeForNumber:sanitizedNumber];
|
||||
STPBINRange *binRange = [STPBINRange mostSpecificBINRangeForNumber:sanitizedNumber];
|
||||
if (binRange.brand == STPCardBrandUnknown && validatingCardBrand) {
|
||||
return STPCardValidationStateInvalid;
|
||||
//return STPCardValidationStateInvalid;
|
||||
}
|
||||
|
||||
if (sanitizedNumber.length == binRange.length) {
|
||||
BOOL isValidLuhn = [self stringIsValidLuhn:sanitizedNumber];
|
||||
return isValidLuhn ? STPCardValidationStateValid : STPCardValidationStateInvalid;
|
||||
@ -167,7 +168,7 @@ static NSString * _Nonnull stringByRemovingCharactersFromSet(NSString * _Nonnull
|
||||
return STPCardValidationStateInvalid;
|
||||
} else {
|
||||
return STPCardValidationStateIncomplete;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
+ (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 autolockDeadine: Signal<Int32?, NoError>
|
||||
public let encryptionProvider: EncryptionProvider
|
||||
public let 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, 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, deviceModelName:String?) {
|
||||
self.apiId = apiId
|
||||
self.apiHash = apiHash
|
||||
self.languagesCategory = languagesCategory
|
||||
@ -443,7 +443,7 @@ public struct NetworkInitializationArguments {
|
||||
self.appData = appData
|
||||
self.autolockDeadine = autolockDeadine
|
||||
self.encryptionProvider = encryptionProvider
|
||||
self.resolvedDeviceName = resolvedDeviceName
|
||||
self.deviceModelName = deviceModelName
|
||||
}
|
||||
}
|
||||
#if os(iOS)
|
||||
@ -458,7 +458,7 @@ func initializedNetwork(accountId: AccountRecordId, arguments: NetworkInitializa
|
||||
|
||||
let serialization = Serialization()
|
||||
|
||||
var apiEnvironment = MTApiEnvironment(resolvedDeviceName: arguments.resolvedDeviceName)
|
||||
var apiEnvironment = MTApiEnvironment(deviceModelName: arguments.deviceModelName)
|
||||
|
||||
apiEnvironment.apiId = arguments.apiId
|
||||
apiEnvironment.langPack = arguments.languagesCategory
|
||||
|
@ -370,7 +370,7 @@ func applyUpdateGroupMessages(postbox: Postbox, stateManager: AccountStateManage
|
||||
mapping.append((message, MessageIndex(id: id, timestamp: storeMessage.timestamp), storeMessage))
|
||||
}
|
||||
} else {
|
||||
assertionFailure()
|
||||
// assertionFailure()
|
||||
}
|
||||
} else {
|
||||
assertionFailure()
|
||||
|
@ -141,7 +141,7 @@ public extension Peer {
|
||||
var isDeleted: Bool {
|
||||
switch self {
|
||||
case let user as TelegramUser:
|
||||
return user.firstName == nil && user.lastName == nil && user.phone == nil
|
||||
return user.firstName == nil && user.lastName == nil
|
||||
default:
|
||||
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",
|
||||
"xcode": "14.2"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user