Make things compile again

pull/313/head
Niels Andriesse 4 years ago
parent 1037ce5113
commit ac6baec6f2

@ -72,6 +72,7 @@ target 'SessionMessagingKit' do
pod 'HKDFKit', :inhibit_warnings => true
pod 'Mantle', git: 'https://github.com/signalapp/Mantle', branch: 'signal-master', :inhibit_warnings => true
pod 'PromiseKit', :inhibit_warnings => true
pod 'PureLayout', '~> 3.1.4', :inhibit_warnings => true
pod 'Reachability', :inhibit_warnings => true
pod 'SAMKeychain', :inhibit_warnings => true
pod 'SignalCoreKit', git: 'https://github.com/signalapp/SignalCoreKit.git', :inhibit_warnings => true
@ -104,6 +105,7 @@ target 'SessionUtilitiesKit' do
pod 'Curve25519Kit', git: 'https://github.com/signalapp/Curve25519Kit.git', :inhibit_warnings => true
pod 'Mantle', git: 'https://github.com/signalapp/Mantle', branch: 'signal-master', :inhibit_warnings => true
pod 'PromiseKit', :inhibit_warnings => true
pod 'PureLayout', '~> 3.1.4', :inhibit_warnings => true
pod 'SAMKeychain', :inhibit_warnings => true
pod 'SignalCoreKit', git: 'https://github.com/signalapp/SignalCoreKit.git', :inhibit_warnings => true
pod 'YapDatabase/SQLCipher', :git => 'https://github.com/signalapp/YapDatabase.git', branch: 'signal-release', :inhibit_warnings => true

@ -230,6 +230,6 @@ SPEC CHECKSUMS:
YYImage: 6db68da66f20d9f169ceb94dfb9947c3867b9665
ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb
PODFILE CHECKSUM: b12682bc3bf974c758ec8e4b9838639f7ec51d5e
PODFILE CHECKSUM: f65f7b4344906f219fb7e1e4ca93b4ed1ac3132a
COCOAPODS: 1.10.0.rc.1

@ -10,17 +10,12 @@ final class Configuration : NSObject {
@objc static func performMainSetup() {
SNMessagingKit.configure(
storage: Storage.shared,
messageSenderDelegate: MessageSenderDelegate.shared,
messageReceiverDelegate: MessageReceiverDelegate.shared,
signalStorage: OWSPrimaryStorage.shared(),
identityKeyStore: OWSIdentityManager.shared(),
sessionRestorationImplementation: SessionRestorationImplementation(),
certificateValidator: SMKCertificateDefaultValidator(trustRoot: OWSUDManagerImpl.trustRoot()),
openGroupAPIDelegate: OpenGroupAPIDelegate.shared,
pnServerURL: PushNotificationAPI.server,
pnServerPublicKey: PushNotificationAPI.serverPublicKey
certificateValidator: SMKCertificateDefaultValidator(trustRoot: OWSUDManagerImpl.trustRoot())
)
SessionProtocolKit.configure(storage: Storage.shared, sharedSenderKeysDelegate: MessageSenderDelegate.shared)
SessionProtocolKit.configure(storage: Storage.shared, sharedSenderKeysDelegate: MessageSender.shared)
SessionSnodeKit.configure(storage: Storage.shared)
SessionUtilitiesKit.configure(owsPrimaryStorage: OWSPrimaryStorage.shared(), maxFileSize: UInt(Double(FileServerAPI.maxFileSize) / FileServerAPI.fileSizeORMultiplier))
}

@ -49,49 +49,49 @@
#import <SignalCoreKit/Threading.h>
#import <SignalUtilitiesKit/AttachmentSharing.h>
#import <SignalUtilitiesKit/ContactTableViewCell.h>
#import <SignalUtilitiesKit/Environment.h>
#import <SignalUtilitiesKit/OWSAudioPlayer.h>
#import <SessionMessagingKit/Environment.h>
#import <SessionMessagingKit/OWSAudioPlayer.h>
#import <SignalUtilitiesKit/OWSFormat.h>
#import <SignalUtilitiesKit/OWSPreferences.h>
#import <SessionMessagingKit/OWSPreferences.h>
#import <SignalUtilitiesKit/OWSProfileManager.h>
#import <SignalUtilitiesKit/OWSQuotedReplyModel.h>
#import <SignalUtilitiesKit/OWSSounds.h>
#import <SessionMessagingKit/OWSQuotedReplyModel.h>
#import <SessionMessagingKit/OWSSounds.h>
#import <SignalUtilitiesKit/OWSViewController.h>
#import <SignalUtilitiesKit/UIColor+OWS.h>
#import <SignalUtilitiesKit/UIFont+OWS.h>
#import <SignalUtilitiesKit/UIUtil.h>
#import <SignalUtilitiesKit/UIView+OWS.h>
#import <SessionUtilitiesKit/UIView+OWS.h>
#import <SignalUtilitiesKit/UIViewController+OWS.h>
#import <SignalUtilitiesKit/AppVersion.h>
#import <SessionUtilitiesKit/DataSource.h>
#import <SessionUtilitiesKit/MIMETypeUtil.h>
#import <SessionUtilitiesKit/NSData+Image.h>
#import <SessionUtilitiesKit/NSNotificationCenter+OWS.h>
#import <SignalUtilitiesKit/NSString+SSK.h>
#import <SessionUtilitiesKit/NSString+SSK.h>
#import <SessionMessagingKit/OWSBackgroundTask.h>
#import <SignalUtilitiesKit/OWSContactsOutputStream.h>
#import <SignalUtilitiesKit/OWSDispatch.h>
#import <SignalUtilitiesKit/OWSError.h>
#import <SessionUtilitiesKit/OWSFileSystem.h>
#import <SessionMessagingKit/OWSIdentityManager.h>
#import <SignalUtilitiesKit/OWSMediaGalleryFinder.h>
#import <SessionMessagingKit/OWSMediaGalleryFinder.h>
#import <SignalUtilitiesKit/OWSPrimaryStorage+SessionStore.h>
#import <SignalUtilitiesKit/OWSRecipientIdentity.h>
#import <SessionMessagingKit/OWSRecipientIdentity.h>
#import <SignalUtilitiesKit/SignalAccount.h>
#import <SignalUtilitiesKit/SignalRecipient.h>
#import <SessionMessagingKit/SignalRecipient.h>
#import <SessionMessagingKit/TSAccountManager.h>
#import <SessionMessagingKit/TSAttachment.h>
#import <SessionMessagingKit/TSAttachmentPointer.h>
#import <SessionMessagingKit/TSAttachmentStream.h>
#import <SessionMessagingKit/TSContactThread.h>
#import <SignalUtilitiesKit/TSErrorMessage.h>
#import <SessionMessagingKit/TSErrorMessage.h>
#import <SessionMessagingKit/TSGroupThread.h>
#import <SessionMessagingKit/TSIncomingMessage.h>
#import <SignalUtilitiesKit/TSInfoMessage.h>
#import <SessionMessagingKit/TSInfoMessage.h>
#import <SessionMessagingKit/TSOutgoingMessage.h>
#import <SignalUtilitiesKit/TSPreKeyManager.h>
#import <SessionMessagingKit/TSThread.h>
#import <SignalUtilitiesKit/LKGroupUtilities.h>
#import <SessionUtilitiesKit/LKGroupUtilities.h>
#import <SessionUtilitiesKit/UIImage+OWS.h>
#import <WebRTC/RTCAudioSession.h>
#import <WebRTC/RTCCameraPreviewView.h>

@ -18,7 +18,7 @@
#import <SignalCoreKit/NSObject+OWS.h>
#import <SignalCoreKit/OWSAsserts.h>
#import <SignalUtilitiesKit/SSKAsserts.h>
#import <SignalUtilitiesKit/NSArray+Functional.h>
#import <SessionUtilitiesKit/NSArray+Functional.h>
#import <SignalUtilitiesKit/NSSet+Functional.h>
#import <SignalUtilitiesKit/NSObject+Casting.h>
#import <SessionUIKit/SessionUIKit.h>

@ -5,8 +5,8 @@
#import "AboutTableViewController.h"
#import "Session-Swift.h"
#import "UIView+OWS.h"
#import <SignalUtilitiesKit/Environment.h>
#import <SignalUtilitiesKit/OWSPreferences.h>
#import <SessionMessagingKit/Environment.h>
#import <SessionMessagingKit/OWSPreferences.h>
#import <SignalUtilitiesKit/UIUtil.h>
#import <SessionMessagingKit/OWSPrimaryStorage.h>
#import <SessionMessagingKit/TSDatabaseView.h>

@ -13,9 +13,9 @@
#import <PromiseKit/AnyPromise.h>
#import <SignalCoreKit/iOSVersions.h>
#import <SignalUtilitiesKit/AppSetup.h>
#import <SignalUtilitiesKit/Environment.h>
#import <SessionMessagingKit/Environment.h>
#import <SignalUtilitiesKit/OWSNavigationController.h>
#import <SignalUtilitiesKit/OWSPreferences.h>
#import <SessionMessagingKit/OWSPreferences.h>
#import <SignalUtilitiesKit/OWSProfileManager.h>
#import <SignalUtilitiesKit/VersionMigrations.h>
#import <SessionMessagingKit/AppReadiness.h>
@ -23,7 +23,7 @@
#import <SessionMessagingKit/OWSDisappearingMessagesJob.h>
#import <SignalUtilitiesKit/OWSFailedAttachmentDownloadsJob.h>
#import <SignalUtilitiesKit/OWSFailedMessagesJob.h>
#import <SignalUtilitiesKit/OWSMath.h>
#import <SessionUtilitiesKit/OWSMath.h>
#import <SessionMessagingKit/OWSReadReceiptManager.h>
#import <SessionMessagingKit/SSKEnvironment.h>
#import <SignalUtilitiesKit/SignalUtilitiesKit-Swift.h>
@ -776,7 +776,6 @@ static NSTimeInterval launchStartedAt;
- (void)startOpenGroupPollersIfNeeded
{
[LKPublicChatManager.shared startPollersIfNeeded];
[SSKEnvironment.shared.attachmentDownloads continueDownloadIfPossible];
}
- (void)stopOpenGroupPollers { [LKPublicChatManager.shared stopPollers]; }

@ -9,7 +9,7 @@
#import <SignalUtilitiesKit/UIUtil.h>
#import <SignalUtilitiesKit/TSGroupModel.h>
#import <SessionMessagingKit/TSGroupModel.h>
#import <SessionMessagingKit/TSGroupThread.h>
#import <SessionMessagingKit/TSThread.h>
#import <SignalUtilitiesKit/SignalUtilitiesKit-Swift.h>

@ -6,7 +6,7 @@
#import "OWSBezierPathView.h"
#import "OWSProgressView.h"
#import <SignalUtilitiesKit/UIFont+OWS.h>
#import <SignalUtilitiesKit/UIView+OWS.h>
#import <SessionUtilitiesKit/UIView+OWS.h>
#import <SessionUtilitiesKit/AppContext.h>
#import <SignalUtilitiesKit/OWSUploadOperation.h>
#import <SessionMessagingKit/TSAttachmentStream.h>

@ -13,12 +13,6 @@ public class ConversationMediaView: UIView {
case failed
}
// MARK: - Dependencies
private var attachmentDownloads: OWSAttachmentDownloads {
return SSKEnvironment.shared.attachmentDownloads
}
// MARK: -
private let mediaCache: NSCache<NSString, AnyObject>
@ -163,11 +157,13 @@ public class ConversationMediaView: UIView {
configure(forError: .invalid)
return
}
/*
guard nil != attachmentDownloads.downloadProgress(forAttachmentId: attachmentId) else {
// Not being downloaded.
configure(forError: .missing)
return
}
*/
backgroundColor = (Theme.isDarkThemeEnabled ? .ows_gray90 : .ows_gray05)
let view: UIView

@ -7,12 +7,6 @@ import Foundation
@objc
public class MediaDownloadView: UIView {
// MARK: - Dependencies
private var attachmentDownloads: OWSAttachmentDownloads {
return SSKEnvironment.shared.attachmentDownloads
}
// MARK: -
private let attachmentId: String
@ -75,13 +69,13 @@ public class MediaDownloadView: UIView {
shapeLayer1.frame = self.bounds
shapeLayer2.frame = self.bounds
guard let progress = attachmentDownloads.downloadProgress(forAttachmentId: attachmentId) else {
Logger.warn("No progress for attachment.")
shapeLayer1.path = nil
shapeLayer2.path = nil
return
}
shapeLayer1.path = nil
shapeLayer2.path = nil
return
// We can't display download progress yet
/*
// Prevent the shape layer from animating changes.
CATransaction.begin()
CATransaction.setDisableActions(true)
@ -115,5 +109,6 @@ public class MediaDownloadView: UIView {
shapeLayer2.fillColor = fillColor2.cgColor
CATransaction.commit()
*/
}
}

@ -4,7 +4,7 @@
#import "OWSBubbleShapeView.h"
#import "OWSBubbleView.h"
#import <SignalUtilitiesKit/UIView+OWS.h>
#import <SessionUtilitiesKit/UIView+OWS.h>
NS_ASSUME_NONNULL_BEGIN

@ -4,7 +4,7 @@
#import "OWSBubbleView.h"
#import "MainAppContext.h"
#import <SignalUtilitiesKit/UIView+OWS.h>
#import <SessionUtilitiesKit/UIView+OWS.h>
#import "Session-Swift.h"
NS_ASSUME_NONNULL_BEGIN

@ -11,7 +11,7 @@
#import <SignalUtilitiesKit/OWSFormat.h>
#import <SignalUtilitiesKit/UIColor+OWS.h>
#import <SessionUtilitiesKit/MIMETypeUtil.h>
#import <SignalUtilitiesKit/NSString+SSK.h>
#import <SessionUtilitiesKit/NSString+SSK.h>
#import <SessionMessagingKit/TSAttachmentStream.h>
#import <SignalCoreKit/NSString+OWS.h>

@ -14,7 +14,7 @@
#import "OWSQuotedMessageView.h"
#import "Session-Swift.h"
#import "UIColor+OWS.h"
#import <SignalUtilitiesKit/UIView+OWS.h>
#import <SessionUtilitiesKit/UIView+OWS.h>
NS_ASSUME_NONNULL_BEGIN
@ -52,13 +52,6 @@ NS_ASSUME_NONNULL_BEGIN
@implementation OWSMessageBubbleView
#pragma mark - Dependencies
- (OWSAttachmentDownloads *)attachmentDownloads
{
return SSKEnvironment.shared.attachmentDownloads;
}
#pragma mark -
- (instancetype)initWithFrame:(CGRect)frame
@ -846,10 +839,6 @@ NS_ASSUME_NONNULL_BEGIN
OWSFailDebug(@"Missing uniqueId.");
return;
}
if ([self.attachmentDownloads downloadProgressForAttachmentId:uniqueId] == nil) {
OWSFailDebug(@"Missing download progress.");
return;
}
UIView *overlayView = [UIView new];
overlayView.backgroundColor = [self.bubbleColor colorWithAlphaComponent:0.5];

@ -8,7 +8,7 @@
#import <SignalUtilitiesKit/OWSUnreadIndicator.h>
#import <SignalUtilitiesKit/UIColor+OWS.h>
#import <SignalUtilitiesKit/UIFont+OWS.h>
#import <SignalUtilitiesKit/UIView+OWS.h>
#import <SessionUtilitiesKit/UIView+OWS.h>
NS_ASSUME_NONNULL_BEGIN

@ -3,7 +3,7 @@
//
#import "OWSMessageTextView.h"
#import <SignalUtilitiesKit/UIView+OWS.h>
#import <SessionUtilitiesKit/UIView+OWS.h>
NS_ASSUME_NONNULL_BEGIN

@ -11,9 +11,9 @@
#import <SignalUtilitiesKit/SignalUtilitiesKit-Swift.h>
#import <SignalUtilitiesKit/UIColor+OWS.h>
#import <SignalUtilitiesKit/UIView+OWS.h>
#import <SessionUtilitiesKit/UIView+OWS.h>
#import <SessionMessagingKit/TSAttachmentStream.h>
#import <SignalUtilitiesKit/TSMessage.h>
#import <SessionMessagingKit/TSMessage.h>
#import <SignalUtilitiesKit/SignalUtilitiesKit-Swift.h>
NS_ASSUME_NONNULL_BEGIN

@ -9,10 +9,10 @@
#import "UIColor+OWS.h"
#import "UIFont+OWS.h"
#import "UIView+OWS.h"
#import <SignalUtilitiesKit/OWSDisappearingConfigurationUpdateInfoMessage.h>
#import <SignalUtilitiesKit/Environment.h>
#import <SignalUtilitiesKit/TSErrorMessage.h>
#import <SignalUtilitiesKit/TSInfoMessage.h>
#import <SessionMessagingKit/OWSDisappearingConfigurationUpdateInfoMessage.h>
#import <SessionMessagingKit/Environment.h>
#import <SessionMessagingKit/TSErrorMessage.h>
#import <SessionMessagingKit/TSInfoMessage.h>
NS_ASSUME_NONNULL_BEGIN

@ -4,7 +4,7 @@
#import "ConversationInputTextView.h"
#import "Session-Swift.h"
#import <SignalUtilitiesKit/NSString+SSK.h>
#import <SessionUtilitiesKit/NSString+SSK.h>
#import <SignalCoreKit/NSString+OWS.h>
NS_ASSUME_NONNULL_BEGIN

@ -12,8 +12,8 @@
#import <PromiseKit/AnyPromise.h>
#import <SignalUtilitiesKit/OWSFormat.h>
#import <SignalUtilitiesKit/SignalUtilitiesKit-Swift.h>
#import <SignalUtilitiesKit/UIView+OWS.h>
#import <SignalUtilitiesKit/TSQuotedMessage.h>
#import <SessionUtilitiesKit/UIView+OWS.h>
#import <SessionMessagingKit/TSQuotedMessage.h>
NS_ASSUME_NONNULL_BEGIN

@ -42,7 +42,7 @@
#import <PromiseKit/AnyPromise.h>
#import <SignalCoreKit/NSDate+OWS.h>
#import <SignalCoreKit/Threading.h>
#import <SignalUtilitiesKit/Environment.h>
#import <SessionMessagingKit/Environment.h>
#import <SignalUtilitiesKit/OWSFormat.h>
#import <SignalUtilitiesKit/OWSNavigationController.h>
#import <SignalUtilitiesKit/OWSUnreadIndicator.h>
@ -51,7 +51,7 @@
#import <SignalUtilitiesKit/UIUtil.h>
#import <SignalUtilitiesKit/UIViewController+OWS.h>
#import <SessionUtilitiesKit/MIMETypeUtil.h>
#import <SignalUtilitiesKit/NSString+SSK.h>
#import <SessionUtilitiesKit/NSString+SSK.h>
#import <SignalUtilitiesKit/OWSAttachmentDownloads.h>
#import <SessionMessagingKit/OWSBlockingManager.h>
#import <SessionMessagingKit/OWSDisappearingMessagesConfiguration.h>
@ -62,9 +62,9 @@
#import <SessionMessagingKit/OWSReadReceiptManager.h>
#import <SignalUtilitiesKit/SignalUtilitiesKit-Swift.h>
#import <SessionMessagingKit/TSAccountManager.h>
#import <SignalUtilitiesKit/TSGroupModel.h>
#import <SignalUtilitiesKit/TSInvalidIdentityKeyReceivingErrorMessage.h>
#import <SignalUtilitiesKit/TSQuotedMessage.h>
#import <SessionMessagingKit/TSGroupModel.h>
#import <SessionMessagingKit/TSInvalidIdentityKeyReceivingErrorMessage.h>
#import <SessionMessagingKit/TSQuotedMessage.h>
#import <YapDatabase/YapDatabase.h>
#import <YapDatabase/YapDatabaseAutoView.h>
#import <YapDatabase/YapDatabaseViewChange.h>
@ -271,11 +271,6 @@ typedef enum : NSUInteger {
return SSKEnvironment.shared.typingIndicators;
}
- (OWSAttachmentDownloads *)attachmentDownloads
{
return SSKEnvironment.shared.attachmentDownloads;
}
- (TSAccountManager *)tsAccountManager
{
OWSAssertDebug(SSKEnvironment.shared.tsAccountManager);
@ -1457,16 +1452,18 @@ typedef enum : NSUInteger {
{
OWSAssert(message);
[self.uiDatabaseConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) {
[self.attachmentDownloads downloadAttachmentsForMessage:message
transaction:transaction
success:^(NSArray<TSAttachmentStream *> *attachmentStreams) {
OWSLogInfo(@"Successfully redownloaded attachment in thread: %@", message.thread);
}
failure:^(NSError *error) {
OWSLogWarn(@"Failed to redownload message with error: %@", error);
}];
}];
// TODO TODO TODO
// [self.uiDatabaseConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) {
// [self.attachmentDownloads downloadAttachmentsForMessage:message
// transaction:transaction
// success:^(NSArray<TSAttachmentStream *> *attachmentStreams) {
// OWSLogInfo(@"Successfully redownloaded attachment in thread: %@", message.thread);
// }
// failure:^(NSError *error) {
// OWSLogWarn(@"Failed to redownload message with error: %@", error);
// }];
// }];
}
- (void)handleUnsentMessageTap:(TSOutgoingMessage *)message
@ -1914,23 +1911,25 @@ typedef enum : NSUInteger {
return;
}
[self.uiDatabaseConnection asyncReadWithBlock:^(YapDatabaseReadTransaction *transaction) {
[self.attachmentDownloads downloadAttachmentPointer:attachmentPointer
success:^(NSArray<TSAttachmentStream *> *attachmentStreams) {
OWSAssertDebug(attachmentStreams.count == 1);
TSAttachmentStream *attachmentStream = attachmentStreams.firstObject;
[LKStorage writeSyncWithBlock:^(YapDatabaseReadWriteTransaction *postSuccessTransaction) {
[message setQuotedMessageThumbnailAttachmentStream:attachmentStream];
[message saveWithTransaction:postSuccessTransaction];
}];
}
failure:^(NSError *error) {
OWSLogWarn(@"Failed to redownload thumbnail with error: %@", error);
[LKStorage writeSyncWithBlock:^(YapDatabaseReadWriteTransaction *postSuccessTransaction) {
[message touchWithTransaction:postSuccessTransaction];
}];
}];
}];
// TODO TODO TODO
// [self.uiDatabaseConnection asyncReadWithBlock:^(YapDatabaseReadTransaction *transaction) {
// [self.attachmentDownloads downloadAttachmentPointer:attachmentPointer
// success:^(NSArray<TSAttachmentStream *> *attachmentStreams) {
// OWSAssertDebug(attachmentStreams.count == 1);
// TSAttachmentStream *attachmentStream = attachmentStreams.firstObject;
// [LKStorage writeSyncWithBlock:^(YapDatabaseReadWriteTransaction *postSuccessTransaction) {
// [message setQuotedMessageThumbnailAttachmentStream:attachmentStream];
// [message saveWithTransaction:postSuccessTransaction];
// }];
// }
// failure:^(NSError *error) {
// OWSLogWarn(@"Failed to redownload thumbnail with error: %@", error);
// [LKStorage writeSyncWithBlock:^(YapDatabaseReadWriteTransaction *postSuccessTransaction) {
// [message touchWithTransaction:postSuccessTransaction];
// }];
// }];
// }];
}
- (void)didTapConversationItem:(id<ConversationViewItem>)viewItem quotedReply:(OWSQuotedReplyModel *)quotedReply

@ -3,6 +3,7 @@
//
#import "ConversationViewLayout.h"
#import <SessionMessagingKit/OWSAudioPlayer.h>
NS_ASSUME_NONNULL_BEGIN

@ -12,9 +12,9 @@
#import "AnyPromise.h"
#import <SignalUtilitiesKit/OWSUnreadIndicator.h>
#import <SessionUtilitiesKit/NSData+Image.h>
#import <SignalUtilitiesKit/NSString+SSK.h>
#import <SessionUtilitiesKit/NSString+SSK.h>
#import <SignalUtilitiesKit/TSInteraction.h>
#import <SessionMessagingKit/TSInteraction.h>
#import <SessionMessagingKit/SSKEnvironment.h>
#import <SignalUtilitiesKit/SignalUtilitiesKit-Swift.h>
@ -449,6 +449,15 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
[self.lastAudioMessageView setProgress:progress / duration];
}
- (void)showInvalidAudioFileAlert
{
OWSAssertIsOnMainThread();
[OWSAlerts
showErrorAlertWithMessage:NSLocalizedString(@"INVALID_AUDIO_FILE_ALERT_ERROR_MESSAGE",
@"Message for the alert indicating that an audio file is invalid.")];
}
#pragma mark - Displayable Text
// TODO: Now that we're caching the displayable text on the view items,

@ -19,7 +19,7 @@
#import <SessionMessagingKit/TSOutgoingMessage.h>
#import <SessionMessagingKit/TSThread.h>
#import <SessionMessagingKit/TSGroupThread.h>
#import <SignalUtilitiesKit/TSGroupModel.h>
#import <SessionMessagingKit/TSGroupModel.h>
#import <YapDatabase/YapDatabase.h>
#import <YapDatabase/YapDatabaseAutoView.h>
#import <YapDatabase/YapDatabaseViewChange.h>

@ -5,7 +5,7 @@
#import "DateUtil.h"
#import <SignalCoreKit/NSDate+OWS.h>
#import <SignalUtilitiesKit/OWSFormat.h>
#import <SignalUtilitiesKit/NSString+SSK.h>
#import <SessionUtilitiesKit/NSString+SSK.h>
NS_ASSUME_NONNULL_BEGIN

@ -5,7 +5,7 @@
#import "MainAppContext.h"
#import "Session-Swift.h"
#import <SignalCoreKit/Threading.h>
#import <SignalUtilitiesKit/Environment.h>
#import <SessionMessagingKit/Environment.h>
#import <SignalUtilitiesKit/OWSProfileManager.h>
#import <SignalUtilitiesKit/SignalUtilitiesKit-Swift.h>
#import <SessionMessagingKit/OWSIdentityManager.h>

@ -5,7 +5,7 @@
#import "NotificationSettingsOptionsViewController.h"
#import "Session-Swift.h"
#import "SignalApp.h"
#import <SignalUtilitiesKit/Environment.h>
#import <SessionMessagingKit/Environment.h>
#import <SignalUtilitiesKit/SignalUtilitiesKit-Swift.h>
@implementation NotificationSettingsOptionsViewController

@ -7,9 +7,9 @@
#import "NotificationSettingsViewController.h"
#import "NotificationSettingsOptionsViewController.h"
#import "OWSSoundSettingsViewController.h"
#import <SignalUtilitiesKit/Environment.h>
#import <SignalUtilitiesKit/OWSPreferences.h>
#import <SignalUtilitiesKit/OWSSounds.h>
#import <SessionMessagingKit/Environment.h>
#import <SessionMessagingKit/OWSPreferences.h>
#import <SessionMessagingKit/OWSSounds.h>
#import <SignalUtilitiesKit/UIUtil.h>
#import "Session-Swift.h"

@ -15,7 +15,7 @@
#import <SessionUtilitiesKit/OWSFileSystem.h>
#import <SessionMessagingKit/TSAttachment.h>
#import <SessionMessagingKit/TSAttachmentStream.h>
#import <SignalUtilitiesKit/TSMessage.h>
#import <SessionMessagingKit/TSMessage.h>
#import <SessionMessagingKit/TSThread.h>
@import CloudKit;

@ -12,7 +12,7 @@
#import <SessionMessagingKit/OWSBackgroundTask.h>
#import <SessionUtilitiesKit/OWSFileSystem.h>
#import <SessionMessagingKit/TSAttachment.h>
#import <SignalUtilitiesKit/TSMessage.h>
#import <SessionMessagingKit/TSMessage.h>
#import <SessionMessagingKit/TSThread.h>
NS_ASSUME_NONNULL_BEGIN

@ -3,7 +3,7 @@
//
#import "TSYapDatabaseObject.h"
#import <SignalUtilitiesKit/OWSBackupFragment.h>
#import <SessionMessagingKit/OWSBackupFragment.h>
NS_ASSUME_NONNULL_BEGIN

@ -8,11 +8,11 @@
#import <PromiseKit/AnyPromise.h>
#import <SignalUtilitiesKit/AttachmentSharing.h>
#import <SignalUtilitiesKit/Environment.h>
#import <SessionMessagingKit/Environment.h>
#import <SignalUtilitiesKit/SignalUtilitiesKit-Swift.h>
#import <SignalUtilitiesKit/UIColor+OWS.h>
#import <SignalUtilitiesKit/UIFont+OWS.h>
#import <SignalUtilitiesKit/UIView+OWS.h>
#import <SessionUtilitiesKit/UIView+OWS.h>
#import <SessionUtilitiesKit/MIMETypeUtil.h>
NS_ASSUME_NONNULL_BEGIN

@ -15,14 +15,14 @@
#import "UIView+OWS.h"
#import <Curve25519Kit/Curve25519.h>
#import <SignalCoreKit/NSDate+OWS.h>
#import <SignalUtilitiesKit/Environment.h>
#import <SessionMessagingKit/Environment.h>
#import <SignalUtilitiesKit/OWSProfileManager.h>
#import <SignalUtilitiesKit/OWSSounds.h>
#import <SessionMessagingKit/OWSSounds.h>
#import <SignalUtilitiesKit/OWSUserProfile.h>
#import <SignalUtilitiesKit/SignalUtilitiesKit-Swift.h>
#import <SignalUtilitiesKit/UIUtil.h>
#import <SignalUtilitiesKit/OWSDisappearingConfigurationUpdateInfoMessage.h>
#import <SessionMessagingKit/OWSDisappearingConfigurationUpdateInfoMessage.h>
#import <SessionMessagingKit/OWSDisappearingMessagesConfiguration.h>
#import <SessionMessagingKit/OWSPrimaryStorage.h>
@ -950,7 +950,7 @@ static CGRect oldframe;
if (gThread.usesSharedSenderKeys) {
NSString *groupPublicKey = [LKGroupUtilities getDecodedGroupID:gThread.groupModel.groupId];
[LKStorage writeSyncWithBlock:^(YapDatabaseReadWriteTransaction *_Nonnull transaction) {
[[SNMessageSenderDelegate leaveGroupWithPublicKey:groupPublicKey transaction:transaction] retainUntilComplete];
[[SNMessageSender leaveGroupWithPublicKey:groupPublicKey transaction:transaction] retainUntilComplete];
}];
}

@ -13,9 +13,9 @@
#import <SessionUtilitiesKit/OWSFileSystem.h>
#import <SessionMessagingKit/OWSPrimaryStorage.h>
#import <SessionMessagingKit/TSAttachmentStream.h>
#import <SignalUtilitiesKit/TSInteraction.h>
#import <SignalUtilitiesKit/TSMessage.h>
#import <SignalUtilitiesKit/TSQuotedMessage.h>
#import <SessionMessagingKit/TSInteraction.h>
#import <SessionMessagingKit/TSMessage.h>
#import <SessionMessagingKit/TSQuotedMessage.h>
#import <SessionMessagingKit/TSThread.h>
#import <SessionMessagingKit/YapDatabaseTransaction+OWS.h>
#import <SignalUtilitiesKit/SignalUtilitiesKit-Swift.h>

@ -3,8 +3,8 @@
//
#import "OWSProgressView.h"
#import <SignalUtilitiesKit/UIView+OWS.h>
#import <SignalUtilitiesKit/OWSMath.h>
#import <SessionUtilitiesKit/UIView+OWS.h>
#import <SessionUtilitiesKit/OWSMath.h>
NS_ASSUME_NONNULL_BEGIN

@ -7,7 +7,7 @@
#import "Session-Swift.h"
#import <SignalUtilitiesKit/ScreenLockViewController.h>
#import <SignalUtilitiesKit/SignalUtilitiesKit-Swift.h>
#import <SignalUtilitiesKit/UIView+OWS.h>
#import <SessionUtilitiesKit/UIView+OWS.h>
NS_ASSUME_NONNULL_BEGIN

@ -4,8 +4,8 @@
#import "OWSSoundSettingsViewController.h"
#import <AVFoundation/AVFoundation.h>
#import <SignalUtilitiesKit/OWSAudioPlayer.h>
#import <SignalUtilitiesKit/OWSSounds.h>
#import <SessionMessagingKit/OWSAudioPlayer.h>
#import <SessionMessagingKit/OWSSounds.h>
#import <SignalUtilitiesKit/SignalUtilitiesKit-Swift.h>
#import <SignalUtilitiesKit/UIUtil.h>
#import "Session-Swift.h"

@ -6,12 +6,12 @@
#import "Session-Swift.h"
#import <SignalCoreKit/NSString+OWS.h>
#import <SignalUtilitiesKit/Environment.h>
#import <SignalUtilitiesKit/OWSPreferences.h>
#import <SessionMessagingKit/Environment.h>
#import <SessionMessagingKit/OWSPreferences.h>
#import <SignalUtilitiesKit/UIColor+OWS.h>
#import <SignalUtilitiesKit/SignalUtilitiesKit-Swift.h>
#import <SignalUtilitiesKit/NSString+SSK.h>
#import <SessionUtilitiesKit/NSString+SSK.h>
#import <SignalUtilitiesKit/ThreadUtil.h>
#import <SessionMessagingKit/OWSReadReceiptManager.h>
#import <SignalUtilitiesKit/SignalUtilitiesKit-Swift.h>

@ -8,7 +8,7 @@
#import "Session-Swift.h"
#import <SignalCoreKit/Threading.h>
#import <SignalUtilitiesKit/DebugLogger.h>
#import <SignalUtilitiesKit/Environment.h>
#import <SessionMessagingKit/Environment.h>
#import <SessionMessagingKit/OWSPrimaryStorage.h>
#import <SessionMessagingKit/TSContactThread.h>
#import <SessionMessagingKit/TSGroupThread.h>

@ -253,7 +253,7 @@ final class EditClosedGroupVC : BaseVC, UITableViewDataSource, UITableViewDelega
}
ModalActivityIndicatorViewController.present(fromViewController: navigationController!, canCancel: false) { [weak self] _ in
Storage.writeSync { [weak self] transaction in
MessageSenderDelegate.update(groupPublicKey, with: members, name: name, transaction: transaction).done(on: DispatchQueue.main) {
MessageSender.update(groupPublicKey, with: members, name: name, transaction: transaction).done(on: DispatchQueue.main) {
guard let self = self else { return }
self.dismiss(animated: true, completion: nil) // Dismiss the loader
popToConversationVC(self)

@ -384,7 +384,7 @@ final class HomeVC : BaseVC, UITableViewDataSource, UITableViewDelegate, UIScrol
} else if let thread = thread as? TSGroupThread, thread.usesSharedSenderKeys == true {
let groupID = thread.groupModel.groupId
let groupPublicKey = LKGroupUtilities.getDecodedGroupID(groupID)
let _ = MessageSenderDelegate.leave(groupPublicKey, using: transaction).ensure {
let _ = MessageSender.leave(groupPublicKey, using: transaction).ensure {
Storage.writeSync { transaction in
thread.removeAllThreadInteractions(with: transaction)
thread.remove(with: transaction)

@ -170,7 +170,7 @@ final class NewClosedGroupVC : BaseVC, UITableViewDataSource, UITableViewDelegat
ModalActivityIndicatorViewController.present(fromViewController: navigationController!, canCancel: false) { [weak self] _ in
var promise: Promise<TSGroupThread>!
Storage.writeSync { transaction in
promise = MessageSenderDelegate.createClosedGroup(name: name, members: selectedContacts, transaction: transaction)
promise = MessageSender.createClosedGroup(name: name, members: selectedContacts, transaction: transaction)
}
let _ = promise.done(on: DispatchQueue.main) { thread in
self?.presentingViewController?.dismiss(animated: true, completion: nil)

@ -8,13 +8,14 @@
#import "OWSFileSystem.h"
#import "OWSIncomingMessageFinder.h"
#import "OWSMediaGalleryFinder.h"
#import <SessionUtilitiesKit/SessionUtilitiesKit.h>
#import "OWSStorage.h"
#import "OWSStorage+Subclass.h"
#import "SSKEnvironment.h"
#import "TSDatabaseSecondaryIndexes.h"
#import "TSDatabaseView.h"
#import <SessionMessagingKit/SessionMessagingKit-Swift.h>
#import <YapDatabase/YapDatabaseConnectionPool.h>
#import "SSKAsserts.h"
NS_ASSUME_NONNULL_BEGIN
@ -27,15 +28,10 @@ NSString *const OWSUIDatabaseConnectionNotificationsKey = @"OWSUIDatabaseConnect
void VerifyRegistrationsForPrimaryStorage(OWSStorage *storage)
{
OWSCAssertDebug(storage);
[[storage newDatabaseConnection] asyncReadWithBlock:^(YapDatabaseReadTransaction *transaction) {
for (NSString *extensionName in storage.registeredExtensionNames) {
OWSLogVerbose(@"Verifying database extension: %@", extensionName);
YapDatabaseViewTransaction *_Nullable viewTransaction = [transaction ext:extensionName];
if (!viewTransaction) {
OWSCFailDebug(@"VerifyRegistrationsForPrimaryStorage missing database extension: %@", extensionName);
[OWSStorage incrementVersionOfDatabaseExtension:extensionName];
}
}
@ -60,8 +56,6 @@ void VerifyRegistrationsForPrimaryStorage(OWSStorage *storage)
+ (instancetype)sharedManager
{
OWSAssertDebug(SSKEnvironment.shared.primaryStorage);
return SSKEnvironment.shared.primaryStorage;
}
@ -88,8 +82,6 @@ void VerifyRegistrationsForPrimaryStorage(OWSStorage *storage)
selector:@selector(yapDatabaseModifiedExternally:)
name:YapDatabaseModifiedExternallyNotification
object:nil];
OWSSingletonAssert();
}
return self;
@ -97,9 +89,6 @@ void VerifyRegistrationsForPrimaryStorage(OWSStorage *storage)
- (void)dealloc
{
// Surface memory leaks by logging the deallocation of this class.
OWSLogVerbose(@"Dealloc: %@", self.class);
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
@ -121,16 +110,11 @@ void VerifyRegistrationsForPrimaryStorage(OWSStorage *storage)
- (void)yapDatabaseModified:(NSNotification *)notification
{
OWSAssertIsOnMainThread();
OWSLogVerbose(@"");
[self updateUIDatabaseConnectionToLatest];
}
- (void)updateUIDatabaseConnectionToLatest
{
OWSAssertIsOnMainThread();
// Notify observers we're about to update the database connection
[[NSNotificationCenter defaultCenter] postNotificationName:OWSUIDatabaseConnectionWillUpdateNotification object:self.dbNotificationObject];
@ -147,7 +131,6 @@ void VerifyRegistrationsForPrimaryStorage(OWSStorage *storage)
- (YapDatabaseConnection *)uiDatabaseConnection
{
OWSAssertIsOnMainThread();
return _uiDatabaseConnection;
}
@ -171,17 +154,12 @@ void VerifyRegistrationsForPrimaryStorage(OWSStorage *storage)
// seeing, this issue only seems to affect sync and not async registrations. We've always
// been opening write transactions before the async registrations complete without negative
// consequences.
OWSAssertDebug(!self.areSyncRegistrationsComplete);
self.areSyncRegistrationsComplete = YES;
}
- (void)runAsyncRegistrationsWithCompletion:(void (^_Nonnull)(void))completion
{
OWSAssertDebug(completion);
OWSAssertDebug(self.database);
OWSLogVerbose(@"async registrations enqueuing.");
// Asynchronously register other extensions.
//
// All sync registrations must be done before all async registrations,
@ -207,9 +185,6 @@ void VerifyRegistrationsForPrimaryStorage(OWSStorage *storage)
[self.database
flushExtensionRequestsWithCompletionQueue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)
completionBlock:^{
OWSAssertDebug(!self.areAsyncRegistrationsComplete);
OWSLogVerbose(@"async registrations complete.");
self.areAsyncRegistrationsComplete = YES;
completion();
@ -225,10 +200,6 @@ void VerifyRegistrationsForPrimaryStorage(OWSStorage *storage)
+ (void)protectFiles
{
OWSLogInfo(@"Database file size: %@", [OWSFileSystem fileSizeOfPath:self.sharedDataDatabaseFilePath]);
OWSLogInfo(@"\t SHM file size: %@", [OWSFileSystem fileSizeOfPath:self.sharedDataDatabaseFilePath_SHM]);
OWSLogInfo(@"\t WAL file size: %@", [OWSFileSystem fileSizeOfPath:self.sharedDataDatabaseFilePath_WAL]);
// Protect the entire new database directory.
[OWSFileSystem protectFileOrFolderAtPath:self.sharedDataDatabaseDirPath];
}
@ -242,9 +213,7 @@ void VerifyRegistrationsForPrimaryStorage(OWSStorage *storage)
{
NSString *databaseDirPath = [[OWSFileSystem appSharedDataDirectoryPath] stringByAppendingPathComponent:@"database"];
if