Merge branch 'charlesmchen/tweakProfilesDebugUI' into release/2.32.0

pull/1/head
Matthew Chen 7 years ago
commit 58b36d18ac

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

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

@ -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 - (void)processWebSocketRequestMessage:(WebSocketProtoWebSocketRequestMessage *)message
{ {
OWSAssertIsOnMainThread(); OWSAssertIsOnMainThread();
@ -756,7 +767,7 @@ NSString *const kNSNotification_OWSWebSocketStateDidChange = @"kNSNotification_O
__block OWSBackgroundTask *_Nullable backgroundTask = __block OWSBackgroundTask *_Nullable backgroundTask =
[OWSBackgroundTask backgroundTaskWithLabelStr:__PRETTY_FUNCTION__]; [OWSBackgroundTask backgroundTaskWithLabelStr:__PRETTY_FUNCTION__];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ dispatch_async(self.serialQueue, ^{
BOOL success = NO; BOOL success = NO;
@try { @try {
NSData *_Nullable decryptedPayload = NSData *_Nullable decryptedPayload =

Loading…
Cancel
Save