|
|
|
@ -259,8 +259,11 @@ NSString *const TSAccountManager_NeedsAccountAttributesUpdateKey = @"TSAccountMa
|
|
|
|
|
|
|
|
|
|
- (uint32_t)getOrGenerateRegistrationId:(YapDatabaseReadWriteTransaction *)transaction
|
|
|
|
|
{
|
|
|
|
|
@synchronized(self)
|
|
|
|
|
{
|
|
|
|
|
// Unlike other methods in this class, there's no need for a `@synchronized` block
|
|
|
|
|
// here, since we're already in a write transaction, and all writes occur on a serial queue.
|
|
|
|
|
//
|
|
|
|
|
// Since other code in this class which uses @synchronized(self) also needs to open write
|
|
|
|
|
// transaction, using @synchronized(self) here, inside of a WriteTransaction risks deadlock.
|
|
|
|
|
uint32_t registrationID = [[transaction objectForKey:TSAccountManager_LocalRegistrationIdKey
|
|
|
|
|
inCollection:TSAccountManager_UserAccountCollection] unsignedIntValue];
|
|
|
|
|
|
|
|
|
@ -273,7 +276,6 @@ NSString *const TSAccountManager_NeedsAccountAttributesUpdateKey = @"TSAccountMa
|
|
|
|
|
inCollection:TSAccountManager_UserAccountCollection];
|
|
|
|
|
}
|
|
|
|
|
return registrationID;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)registerForPushNotificationsWithPushToken:(NSString *)pushToken
|
|
|
|
|