diff --git a/Podfile.lock b/Podfile.lock index 5e2655492..0bd4e189d 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -136,7 +136,7 @@ CHECKOUT OPTIONS: :commit: 7054e4b13ee5bcd6d524adb6dc9a726e8c466308 :git: https://github.com/WhisperSystems/JSQMessagesViewController.git SignalServiceKit: - :commit: 435f13f2ffc4631aeb282fc02a8a3305f6e8645b + :commit: 33df1fb6c03893233fb6b8dd05e09b0271d41344 :git: https://github.com/WhisperSystems/SignalServiceKit.git SocketRocket: :commit: 877ac7438be3ad0b45ef5ca3969574e4b97112bf diff --git a/Signal/src/Models/OWSCall.h b/Signal/src/Models/OWSCall.h index 419ae4f5d..1cc02012a 100644 --- a/Signal/src/Models/OWSCall.h +++ b/Signal/src/Models/OWSCall.h @@ -18,6 +18,7 @@ typedef enum : NSUInteger { // kGroupUpdateJoin has been deprecated. kGroupUpdateLeft = 7, kGroupUpdate = 8, + kCallMissedBecauseOfChangedIdentity = 9, } CallStatus; @interface OWSCall : NSObject diff --git a/Signal/src/Models/OWSCall.m b/Signal/src/Models/OWSCall.m index f945bae12..f05a9264a 100644 --- a/Signal/src/Models/OWSCall.m +++ b/Signal/src/Models/OWSCall.m @@ -54,6 +54,9 @@ NS_ASSUME_NONNULL_BEGIN case RPRecentCallTypeIncomingIncomplete: status = kCallIncomingIncomplete; break; + case RPRecentCallTypeMissedBecauseOfChangedIdentity: + status = kCallMissedBecauseOfChangedIdentity; + break; default: status = kCallIncoming; break; @@ -77,6 +80,9 @@ NS_ASSUME_NONNULL_BEGIN case kCallOutgoingIncomplete: detailString = [NSString stringWithFormat:NSLocalizedString(@"MSGVIEW_YOU_TRIED_TO_CALL", nil), name]; break; + case kCallMissedBecauseOfChangedIdentity: + detailString = [NSString + stringWithFormat:NSLocalizedString(@"MSGVIEW_MISSED_CALL_BECAUSE_OF_CHANGED_IDENTITY", nil), name]; default: detailString = @""; break; diff --git a/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m b/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m index 4f9eadf9b..d4b485976 100644 --- a/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m +++ b/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m @@ -576,6 +576,10 @@ NS_ASSUME_NONNULL_BEGIN withCallNumber:@"+19174054215" callType:RPRecentCallTypeMissed inThread:contactThread]]; + [result addObject:[[TSCall alloc] initWithTimestamp:[NSDate ows_millisecondTimeStamp] + withCallNumber:@"+19174054215" + callType:RPRecentCallTypeMissedBecauseOfChangedIdentity + inThread:contactThread]]; [result addObject:[[TSCall alloc] initWithTimestamp:[NSDate ows_millisecondTimeStamp] withCallNumber:@"+19174054215" callType:RPRecentCallTypeOutgoingIncomplete diff --git a/Signal/src/call/CallService.swift b/Signal/src/call/CallService.swift index 9cb75a79c..488bd4439 100644 --- a/Signal/src/call/CallService.swift +++ b/Signal/src/call/CallService.swift @@ -486,6 +486,14 @@ protocol CallServiceObserver: class { self.notificationsAdapter.presentMissedCallBecauseOfNoLongerVerifiedIdentity(call: newCall, callerName: callerName) } + let callRecord = TSCall(timestamp: NSDate.ows_millisecondTimeStamp(), + withCallNumber: thread.contactIdentifier(), + callType: RPRecentCallTypeMissedBecauseOfChangedIdentity, + in: thread) + assert(newCall.callRecord == nil) + newCall.callRecord = callRecord + callRecord.save() + return } diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index 08c90eec1..0bcce26a9 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -616,6 +616,9 @@ /* No comment provided by engineer. */ "INCOMING_INCOMPLETE_CALL" = "Incomplete incoming call from"; +/* info message text shown in conversation view */ +"INFO_MESSAGE_MISSED_CALL_DUE_TO_CHANGED_IDENITY" = "Missed call because their safety number has changed."; + /* Message for the alert indicating that an audio file is invalid. */ "INVALID_AUDIO_FILE_ALERT_ERROR_MESSAGE" = "Invalid audio file."; @@ -756,6 +759,9 @@ Alert title when camera is not authorized */ "MISSING_CAMERA_PERMISSION_TITLE" = "Signal needs to access your camera."; +/* No comment provided by engineer. */ +"MSGVIEW_MISSED_CALL_BECAUSE_OF_CHANGED_IDENTITY" = "Missed call because their safety number has changed."; + /* notification title. Embeds {{caller's name or phone number}} */ "MSGVIEW_MISSED_CALL_WITH_NAME" = "Missed call from %@.";