Inform linked devices about profile changes.

This commit is contained in:
Matthew Chen 2018-10-31 12:44:53 -04:00
parent 338364eff1
commit ac051fc89e
1 changed files with 13 additions and 0 deletions

View File

@ -227,6 +227,14 @@ typedef void (^ProfileManagerFailureBlock)(NSError *error);
void (^failureBlock)(void) = ^{
OWSLogError(@"Updating service with profile failed.");
// 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".
//
// NOTE: We also inform the desktop in the failure case,
// since that _may have_ affected service state.
[self.syncManager syncLocalContact];
dispatch_async(dispatch_get_main_queue(), ^{
failureBlockParameter();
});
@ -234,6 +242,11 @@ typedef void (^ProfileManagerFailureBlock)(NSError *error);
void (^successBlock)(void) = ^{
OWSLogInfo(@"Successfully updated service with profile.");
// 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];
dispatch_async(dispatch_get_main_queue(), ^{
successBlockParameter();
});