|
|
|
@ -230,6 +230,7 @@ typedef void (^ProfileManagerFailureBlock)(NSError *error);
|
|
|
|
|
avatarImage:(nullable UIImage *)avatarImage
|
|
|
|
|
success:(void (^)(void))successBlockParameter
|
|
|
|
|
failure:(void (^)(NSError *))failureBlockParameter
|
|
|
|
|
requiresSync:(BOOL)requiresSync
|
|
|
|
|
{
|
|
|
|
|
OWSAssertDebug(successBlockParameter);
|
|
|
|
|
OWSAssertDebug(failureBlockParameter);
|
|
|
|
@ -244,7 +245,9 @@ typedef void (^ProfileManagerFailureBlock)(NSError *error);
|
|
|
|
|
//
|
|
|
|
|
// NOTE: We also inform the desktop in the failure case,
|
|
|
|
|
// since that _may have_ affected service state.
|
|
|
|
|
[[self.syncManager syncLocalContact] retainUntilComplete];
|
|
|
|
|
if (requiresSync) {
|
|
|
|
|
[[self.syncManager syncLocalContact] retainUntilComplete];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
failureBlockParameter(error);
|
|
|
|
@ -256,7 +259,9 @@ typedef void (^ProfileManagerFailureBlock)(NSError *error);
|
|
|
|
|
// We use a "self-only" contact sync to indicate to desktop
|
|
|
|
|
// that we've changed our profile and that it should do a
|
|
|
|
|
// profile fetch for "self".
|
|
|
|
|
[[self.syncManager syncLocalContact] retainUntilComplete];
|
|
|
|
|
if (requiresSync) {
|
|
|
|
|
[[self.syncManager syncLocalContact] retainUntilComplete];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
successBlockParameter();
|
|
|
|
|