@ -61,6 +61,9 @@ NS_ASSUME_NONNULL_BEGIN
} ] ,
] ] ] ;
if ( [ thread isKindOfClass : [ TSContactThread class ] ] ) {
TSContactThread * contactThread = ( TSContactThread * ) thread ;
[ contents
addSection : [ OWSTableSection
sectionWithTitle : @ "Session State "
@ -75,29 +78,42 @@ NS_ASSUME_NONNULL_BEGIN
[ [ TSStorageManager sharedManager ] printAllSessions ] ;
} ) ;
} ] ,
[ OWSTableItem itemWithTitle : @ "Toggle Key Change ( Contact Thread Only ) "
actionBlock : ^{
DDLogError (
@ "Flipping identity Key . Flip again to return . ") ;
OWSIdentityManager * identityManager =
[ OWSIdentityManager sharedManager ] ;
NSString * recipientId = [ contactThread contactIdentifier ] ;
NSData * currentKey = [ identityManager
identityKeyForRecipientId : recipientId ] ;
NSMutableData * flippedKey = [ NSMutableData new ] ;
const char * currentKeyBytes = currentKey . bytes ;
for ( NSUInteger i = 0 ; i < currentKey . length ; i + + ) {
const char xorByte = currentKeyBytes [ i ] ^ 0 xff ;
[ flippedKey appendBytes : & xorByte length : 1 ] ;
}
OWSAssert ( flippedKey . length == 32 ) ;
[ identityManager saveRemoteIdentity : flippedKey
recipientId : recipientId ] ;
} ] ,
[ OWSTableItem
itemWithTitle : @ "Delete session ( Contact Thread Only ) "
actionBlock : ^{
if ( ![ thread isKindOfClass : [ TSContactThread class ] ] ) {
DDLogError ( @ "Refusing to delete session for group thread . ") ;
OWSAssert ( NO ) ;
return ;
}
TSContactThread * contactThread = ( TSContactThread * ) thread ;
dispatch_async ( [ OWSDispatch sessionStoreQueue ] , ^{
[ [ TSStorageManager sharedManager ]
deleteAllSessionsForContact : contactThread . contactIdentifier ] ;
deleteAllSessionsForContact : contactThread
. contactIdentifier ] ;
} ) ;
} ] ,
[ OWSTableItem
itemWithTitle : @ "Send session reset ( Contact Thread Only ) "
actionBlock : ^{
if ( ![ thread isKindOfClass : [ TSContactThread class ] ] ) {
DDLogError ( @ "Refusing to reset session for group thread . ") ;
OWSAssert ( NO ) ;
return ;
}
TSContactThread * contactThread = ( TSContactThread * ) thread ;
[ OWSSessionResetJob
runWithContactThread : contactThread
messageSender : [ Environment getCurrent ] . messageSender
@ -105,10 +121,8 @@ NS_ASSUME_NONNULL_BEGIN
} ]
] ] ] ;
[ contents addSection : [ DebugUIContacts section ] ] ;
/ / After enqueing the notification you may want to background the app or lock the screen before it triggers , so we
/ / give a little delay .
/ / After enqueing the notification you may want to background the app or lock the screen before it triggers , so
/ / we give a little delay .
uint64_t notificationDelay = 5 ;
[ contents
addSection :
@ -116,7 +130,8 @@ NS_ASSUME_NONNULL_BEGIN
sectionWithTitle : [ NSString
stringWithFormat : @ "Call Notifications ( %llu second delay)", notificationDelay]
items : @ [
[ OWSTableItem itemWithTitle : @ "Missed Call "
[ OWSTableItem
itemWithTitle : @ "Missed Call "
actionBlock : ^{
SignalCall * call =
[ SignalCall incomingCallWithLocalId : [ NSUUID new ]
@ -135,7 +150,8 @@ NS_ASSUME_NONNULL_BEGIN
[ OWSTableItem
itemWithTitle : @ "Rejected Call with New Safety Number "
actionBlock : ^{
SignalCall * call = [ SignalCall incomingCallWithLocalId : [ NSUUID new ]
SignalCall * call =
[ SignalCall incomingCallWithLocalId : [ NSUUID new ]
remotePhoneNumber : thread . contactIdentifier
signalingId : 0 ] ;
@ -151,7 +167,8 @@ NS_ASSUME_NONNULL_BEGIN
[ OWSTableItem
itemWithTitle : @ "Rejected Call with No Longer Verified Safety Number "
actionBlock : ^{
SignalCall * call = [ SignalCall incomingCallWithLocalId : [ NSUUID new ]
SignalCall * call =
[ SignalCall incomingCallWithLocalId : [ NSUUID new ]
remotePhoneNumber : thread . contactIdentifier
signalingId : 0 ] ;
@ -162,10 +179,14 @@ NS_ASSUME_NONNULL_BEGIN
[ [ Environment getCurrent ] . callService . notificationsAdapter
presentMissedCallBecauseOfNoLongerVerifiedIdentityWithCall : call
callerName :
thread . name ] ;
thread
. name ] ;
} ) ;
} ] ,
] ] ] ;
} / / end contact thread section
[ contents addSection : [ DebugUIContacts section ] ] ;
viewController . contents = contents ;
[ viewController presentFromViewController : fromViewController ] ;