Fix rebase breakage.

pull/1/head
Matthew Chen 6 years ago
parent a4cdc5272c
commit 0d588346f1

@ -263,7 +263,7 @@ CHECKOUT OPTIONS:
:commit: ff0b95770520133b83a4bd7b26bc2c90b51abc4d :commit: ff0b95770520133b83a4bd7b26bc2c90b51abc4d
:git: https://github.com/signalapp/SignalCoreKit.git :git: https://github.com/signalapp/SignalCoreKit.git
SignalMetadataKit: SignalMetadataKit:
:commit: beb10a358db0202228b8d67bcb466d877fefb405 :commit: 90f3dee7122ff13061770c496001135ba90b71e3
:git: https://github.com/signalapp/SignalMetadataKit :git: https://github.com/signalapp/SignalMetadataKit
SocketRocket: SocketRocket:
:commit: 9f9563a83cd8960503074aa8de72206f83fb7a69 :commit: 9f9563a83cd8960503074aa8de72206f83fb7a69

@ -996,12 +996,13 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
OWSLogWarn(@"Sending a message with no device messages."); OWSLogWarn(@"Sending a message with no device messages.");
} }
const BOOL isUDSend = messageSend.isUDSend;
TSRequest *request = [OWSRequestFactory submitMessageRequestWithRecipient:recipient.uniqueId TSRequest *request = [OWSRequestFactory submitMessageRequestWithRecipient:recipient.uniqueId
messages:deviceMessages messages:deviceMessages
timeStamp:message.timestamp timeStamp:message.timestamp
unidentifiedAccess:messageSend.unidentifiedAccess]; unidentifiedAccess:messageSend.unidentifiedAccess];
OWSWebSocketType webSocketType = (messageSend.isUDSend ? OWSWebSocketTypeUD : OWSWebSocketTypeDefault); OWSWebSocketType webSocketType = (isUDSend ? OWSWebSocketTypeUD : OWSWebSocketTypeDefault);
BOOL canMakeWebsocketRequests = ([TSSocketManager.shared canMakeRequestsOfType:webSocketType] && BOOL canMakeWebsocketRequests = ([TSSocketManager.shared canMakeRequestsOfType:webSocketType] &&
!messageSend.hasWebsocketSendFailed); !messageSend.hasWebsocketSendFailed);
if (canMakeWebsocketRequests) { if (canMakeWebsocketRequests) {
@ -1018,7 +1019,8 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
// If a UD send fails due to service response (as opposed to network // If a UD send fails due to service response (as opposed to network
// failure), mark recipient as _not_ in UD mode, then retry. // failure), mark recipient as _not_ in UD mode, then retry.
OWSLogDebug(@"UD send failed; failing over to non-UD send."); OWSLogDebug(@"UD send failed; failing over to non-UD send.");
[self.udManager setSupportsUnidentifiedDelivery:NO recipientId:recipient.uniqueId]; [self.udManager setUnidentifiedAccessMode:UnidentifiedAccessModeDisabled
recipientId:recipient.uniqueId];
messageSend.hasUDAuthFailed = YES; messageSend.hasUDAuthFailed = YES;
dispatch_async([OWSDispatch sendingQueue], ^{ dispatch_async([OWSDispatch sendingQueue], ^{
[self sendMessageToRecipient:messageSend]; [self sendMessageToRecipient:messageSend];
@ -1043,7 +1045,7 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
NSInteger statusCode = response.statusCode; NSInteger statusCode = response.statusCode;
NSData *_Nullable responseData = error.userInfo[AFNetworkingOperationFailingURLResponseDataErrorKey]; NSData *_Nullable responseData = error.userInfo[AFNetworkingOperationFailingURLResponseDataErrorKey];
if (messageSend.isUDSend && (statusCode == 401 || statusCode == 403)) { if (isUDSend && (statusCode == 401 || statusCode == 403)) {
// If a UD send fails due to service response (as opposed to network // If a UD send fails due to service response (as opposed to network
// failure), mark recipient as _not_ in UD mode, then retry. // failure), mark recipient as _not_ in UD mode, then retry.
OWSLogDebug(@"UD send failed; failing over to non-UD send."); OWSLogDebug(@"UD send failed; failing over to non-UD send.");

Loading…
Cancel
Save