move ContactsManager to local dependency

pull/1/head
Michael Kirk 7 years ago
parent fe84275cce
commit c2aee429b1

@ -153,6 +153,10 @@ public class NotificationPresenter: NSObject, NotificationsProtocol {
// MARK: - Dependencies // MARK: - Dependencies
var contactsManager: OWSContactsManager {
return Environment.shared.contactsManager
}
var identityManager: OWSIdentityManager { var identityManager: OWSIdentityManager {
return OWSIdentityManager.shared() return OWSIdentityManager.shared()
} }
@ -332,8 +336,7 @@ public class NotificationPresenter: NSObject, NotificationsProtocol {
} }
} }
// MJK TODO DI contactsManager public func notifyUser(for incomingMessage: TSIncomingMessage, in thread: TSThread, transaction: YapDatabaseReadTransaction) {
public func notifyUser(for incomingMessage: TSIncomingMessage, in thread: TSThread, contactsManager: ContactsManagerProtocol, transaction: YapDatabaseReadTransaction) {
guard !thread.isMuted else { guard !thread.isMuted else {
return return

@ -170,7 +170,6 @@ class DebugUINotifications: DebugUIPage {
self.notificationPresenter.notifyUser(for: incomingMessage, self.notificationPresenter.notifyUser(for: incomingMessage,
in: thread, in: thread,
contactsManager: self.contactsManager,
transaction: transaction) transaction: transaction)
} }
} }

@ -1490,7 +1490,6 @@ NS_ASSUME_NONNULL_BEGIN
[SSKEnvironment.shared.notificationsManager notifyUserForIncomingMessage:incomingMessage [SSKEnvironment.shared.notificationsManager notifyUserForIncomingMessage:incomingMessage
inThread:thread inThread:thread
contactsManager:self.contactsManager
transaction:transaction]; transaction:transaction];
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{

@ -1,5 +1,5 @@
// //
// Copyright (c) 2018 Open Whisper Systems. All rights reserved. // Copyright (c) 2019 Open Whisper Systems. All rights reserved.
// //
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@ -16,7 +16,6 @@ NS_ASSUME_NONNULL_BEGIN
- (void)notifyUserForIncomingMessage:(TSIncomingMessage *)incomingMessage - (void)notifyUserForIncomingMessage:(TSIncomingMessage *)incomingMessage
inThread:(TSThread *)thread inThread:(TSThread *)thread
contactsManager:(id<ContactsManagerProtocol>)contactsManager
transaction:(YapDatabaseReadTransaction *)transaction; transaction:(YapDatabaseReadTransaction *)transaction;
- (void)notifyUserForErrorMessage:(TSErrorMessage *)error - (void)notifyUserForErrorMessage:(TSErrorMessage *)error

@ -5,7 +5,7 @@
@objc @objc
public class NoopNotificationsManager: NSObject, NotificationsProtocol { public class NoopNotificationsManager: NSObject, NotificationsProtocol {
public func notifyUser(for incomingMessage: TSIncomingMessage, in thread: TSThread, contactsManager: ContactsManagerProtocol, transaction: YapDatabaseReadTransaction) { public func notifyUser(for incomingMessage: TSIncomingMessage, in thread: TSThread, transaction: YapDatabaseReadTransaction) {
owsFailDebug("") owsFailDebug("")
} }

Loading…
Cancel
Save