mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Clean up ahead of CR.
This commit is contained in:
parent
f68f3cc53d
commit
a5c42ecca8
4 changed files with 2 additions and 25 deletions
|
@ -57,9 +57,6 @@ class WebRTCCallMessageHandler: NSObject, OWSCallMessageHandler {
|
|||
|
||||
public func receivedIceUpdate(_ iceUpdate: OWSSignalServiceProtosCallMessageIceUpdate, from callerId: String) {
|
||||
SwiftAssertIsOnMainThread(#function)
|
||||
|
||||
Logger.verbose("\(logTag) \(#function)")
|
||||
|
||||
guard iceUpdate.hasId() else {
|
||||
owsFail("no callId in \(#function)")
|
||||
return
|
||||
|
|
|
@ -375,8 +375,6 @@ NSString *const OWSMessageContentJobFinderExtensionGroup = @"OWSMessageContentJo
|
|||
{
|
||||
AssertOnDispatchQueue(self.serialQueue);
|
||||
|
||||
DDLogVerbose(@"%@ %s: %zd", self.logTag, __PRETTY_FUNCTION__, jobs.count);
|
||||
|
||||
NSMutableArray<OWSMessageContentJob *> *processedJobs = [NSMutableArray new];
|
||||
[self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
||||
for (OWSMessageContentJob *job in jobs) {
|
||||
|
@ -403,7 +401,6 @@ NSString *const OWSMessageContentJobFinderExtensionGroup = @"OWSMessageContentJo
|
|||
}
|
||||
}
|
||||
}];
|
||||
DDLogVerbose(@"%@ %s complete: %zd", self.logTag, __PRETTY_FUNCTION__, processedJobs.count);
|
||||
return processedJobs;
|
||||
}
|
||||
|
||||
|
@ -491,8 +488,6 @@ NSString *const OWSMessageContentJobFinderExtensionGroup = @"OWSMessageContentJo
|
|||
OWSAssert(envelopeData);
|
||||
OWSAssert(transaction);
|
||||
|
||||
DDLogVerbose(@"%@ %s", self.logTag, __PRETTY_FUNCTION__);
|
||||
|
||||
// We need to persist the decrypted envelope data ASAP to prevent data loss.
|
||||
[self.processingQueue enqueueEnvelopeData:envelopeData plaintextData:plaintextData transaction:transaction];
|
||||
|
||||
|
|
|
@ -296,23 +296,19 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
if (envelope.hasContent) {
|
||||
OWSSignalServiceProtosContent *content = [OWSSignalServiceProtosContent parseFromData:plaintextData];
|
||||
DDLogInfo(@"%@ content/sync", self.logTag);
|
||||
DDLogInfo(@"%@ handling content: <Content: %@>", self.logTag, [self descriptionForContent:content]);
|
||||
|
||||
if (content.hasSyncMessage) {
|
||||
DDLogInfo(@"%@ handling content: <Content: %@>", self.logTag, [self descriptionForContent:content]);
|
||||
[self handleIncomingEnvelope:envelope withSyncMessage:content.syncMessage transaction:transaction];
|
||||
|
||||
[[OWSDeviceManager sharedManager] setHasReceivedSyncMessage];
|
||||
} else if (content.hasDataMessage) {
|
||||
DDLogInfo(@"%@ content/data", self.logTag);
|
||||
[self handleIncomingEnvelope:envelope withDataMessage:content.dataMessage transaction:transaction];
|
||||
} else if (content.hasCallMessage) {
|
||||
DDLogInfo(@"%@ content/call", self.logTag);
|
||||
[self handleIncomingEnvelope:envelope withCallMessage:content.callMessage];
|
||||
} else if (content.hasNullMessage) {
|
||||
DDLogInfo(@"%@ content/null", self.logTag);
|
||||
DDLogInfo(@"%@ Received null message.", self.logTag);
|
||||
} else if (content.hasReceiptMessage) {
|
||||
DDLogInfo(@"%@ content/receipt", self.logTag);
|
||||
[self handleIncomingEnvelope:envelope withReceiptMessage:content.receiptMessage transaction:transaction];
|
||||
} else {
|
||||
DDLogWarn(@"%@ Ignoring envelope. Content with no known payload", self.logTag);
|
||||
|
@ -473,8 +469,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
OWSAssert(envelope);
|
||||
OWSAssert(callMessage);
|
||||
|
||||
DDLogVerbose(@"%@ handleIncomingEnvelope:withCallMessage:", self.logTag);
|
||||
|
||||
if ([callMessage hasProfileKey]) {
|
||||
NSData *profileKey = [callMessage profileKey];
|
||||
NSString *recipientId = envelope.source;
|
||||
|
@ -486,26 +480,19 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
// definition will end if the app exits.
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (callMessage.hasOffer) {
|
||||
DDLogVerbose(@"%@ handleIncomingEnvelope:withCallMessage -> offer:", self.logTag);
|
||||
[self.callMessageHandler receivedOffer:callMessage.offer fromCallerId:envelope.source];
|
||||
} else if (callMessage.hasAnswer) {
|
||||
DDLogVerbose(@"%@ handleIncomingEnvelope:withCallMessage -> answer:", self.logTag);
|
||||
[self.callMessageHandler receivedAnswer:callMessage.answer fromCallerId:envelope.source];
|
||||
} else if (callMessage.iceUpdate.count > 0) {
|
||||
DDLogVerbose(
|
||||
@"%@ handleIncomingEnvelope:withCallMessage -> ice: %zd", self.logTag, callMessage.iceUpdate.count);
|
||||
for (OWSSignalServiceProtosCallMessageIceUpdate *iceUpdate in callMessage.iceUpdate) {
|
||||
[self.callMessageHandler receivedIceUpdate:iceUpdate fromCallerId:envelope.source];
|
||||
}
|
||||
} else if (callMessage.hasHangup) {
|
||||
DDLogVerbose(@"%@ handleIncomingEnvelope:withCallMessage -> hangup:", self.logTag);
|
||||
DDLogVerbose(@"%@ Received CallMessage with Hangup.", self.logTag);
|
||||
[self.callMessageHandler receivedHangup:callMessage.hangup fromCallerId:envelope.source];
|
||||
} else if (callMessage.hasBusy) {
|
||||
DDLogVerbose(@"%@ handleIncomingEnvelope:withCallMessage -> busy:", self.logTag);
|
||||
[self.callMessageHandler receivedBusy:callMessage.busy fromCallerId:envelope.source];
|
||||
} else {
|
||||
DDLogVerbose(@"%@ handleIncomingEnvelope:withCallMessage -> unknown:", self.logTag);
|
||||
OWSProdInfoWEnvelope([OWSAnalyticsEvents messageManagerErrorCallMessageNoActionablePayload], envelope);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -443,8 +443,6 @@ NSString *const OWSMessageDecryptJobFinderExtensionGroup = @"OWSMessageProcessin
|
|||
|
||||
- (void)handleReceivedEnvelope:(OWSSignalServiceProtosEnvelope *)envelope
|
||||
{
|
||||
DDLogVerbose(@"%@ %s", self.logTag, __PRETTY_FUNCTION__);
|
||||
|
||||
// Drop any too-large messages on the floor. Well behaving clients should never send them.
|
||||
NSUInteger kMaxEnvelopeByteCount = 250 * 1024;
|
||||
if (envelope.serializedSize > kMaxEnvelopeByteCount) {
|
||||
|
|
Loading…
Reference in a new issue