Improve Profiles Debug UI.

This commit is contained in:
Matthew Chen 2018-12-03 08:56:31 -05:00
parent db3c0c6312
commit aa4fea64cf
3 changed files with 18 additions and 1 deletions

View File

@ -35,6 +35,11 @@ class DebugUIProfile: DebugUIPage {
OWSTableItem(title: "Log User Profiles") {
profileManager.logUserProfiles()
},
OWSTableItem(title: "Log Profile Key") {
let localProfileKey = profileManager.localProfileKey()
Logger.info("localProfileKey: \(localProfileKey.keyData.hexadecimalString)")
profileManager.logUserProfiles()
},
OWSTableItem(title: "Regenerate Profile/ProfileKey") {
profileManager.regenerateLocalProfile()
},

View File

@ -851,6 +851,7 @@ typedef void (^ProfileManagerFailureBlock)(NSError *error);
{
OWSUserProfile *userProfile = self.localUserProfile;
[userProfile clearWithProfileKey:[OWSAES256Key generateRandomKey] dbConnection:self.dbConnection completion:nil];
[self.tsAccountManager updateAccountAttributes];
}
- (void)addUserToProfileWhitelist:(NSString *)recipientId

View File

@ -741,6 +741,17 @@ NSString *const kNSNotification_OWSWebSocketStateDidChange = @"kNSNotification_O
}
}
- (dispatch_queue_t)serialQueue
{
static dispatch_queue_t _serialQueue;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
_serialQueue = dispatch_queue_create("org.signal.websocket", DISPATCH_QUEUE_SERIAL);
});
return _serialQueue;
}
- (void)processWebSocketRequestMessage:(WebSocketProtoWebSocketRequestMessage *)message
{
OWSAssertIsOnMainThread();
@ -756,7 +767,7 @@ NSString *const kNSNotification_OWSWebSocketStateDidChange = @"kNSNotification_O
__block OWSBackgroundTask *_Nullable backgroundTask =
[OWSBackgroundTask backgroundTaskWithLabelStr:__PRETTY_FUNCTION__];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
dispatch_async(self.serialQueue, ^{
BOOL success = NO;
@try {
NSData *_Nullable decryptedPayload =