Update notification service

This commit is contained in:
Ali
2021-02-19 19:07:31 +04:00
parent c2ef0d70a7
commit 2d2f434b20
8 changed files with 72 additions and 10 deletions

View File

@@ -116,10 +116,12 @@
@implementation AccountDatacenterInfo
- (instancetype)initWithMasterKey:(AccountDatacenterKey *)masterKey addressList:(NSArray<AccountDatacenterAddress *> *)addressList {
- (instancetype)initWithMasterKey:(AccountDatacenterKey *)masterKey ephemeralMainKey:(AccountDatacenterKey * _Nullable)ephemeralMainKey ephemeralMediaKey:(AccountDatacenterKey * _Nullable)ephemeralMediaKey addressList:(NSArray<AccountDatacenterAddress *> *)addressList {
self = [super init];
if (self != nil) {
_masterKey = masterKey;
_ephemeralMainKey = ephemeralMainKey;
_ephemeralMediaKey = ephemeralMediaKey;
_addressList = addressList;
}
return self;
@@ -135,6 +137,18 @@
return nil;
}
NSDictionary *ephemeralMainKeyDict = dict[@"ephemeralMainKey"];
AccountDatacenterKey *ephemeralMainKey = nil;
if ([ephemeralMainKeyDict isKindOfClass:[NSDictionary class]]) {
ephemeralMainKey = [AccountDatacenterKey parse:ephemeralMainKeyDict];
}
NSDictionary *ephemeralMediaKeyDict = dict[@"ephemeralMediaKey"];
AccountDatacenterKey *ephemeralMediaKey = nil;
if ([ephemeralMediaKeyDict isKindOfClass:[NSDictionary class]]) {
ephemeralMediaKey = [AccountDatacenterKey parse:ephemeralMediaKeyDict];
}
NSArray *addressListArray = dict[@"addressList"];
if (![addressListArray isKindOfClass:[NSArray class]]) {
return nil;
@@ -152,7 +166,7 @@
[addressList addObject:address];
}
return [[AccountDatacenterInfo alloc] initWithMasterKey:masterKey addressList:addressList];
return [[AccountDatacenterInfo alloc] initWithMasterKey:masterKey ephemeralMainKey:ephemeralMainKey ephemeralMediaKey:ephemeralMediaKey addressList:addressList];
}
@end