diff --git a/SignalMessaging/attachments/MessageApprovalViewController.swift b/SignalMessaging/attachments/MessageApprovalViewController.swift index 084c53e9d..859522b0a 100644 --- a/SignalMessaging/attachments/MessageApprovalViewController.swift +++ b/SignalMessaging/attachments/MessageApprovalViewController.swift @@ -23,13 +23,7 @@ public class MessageApprovalViewController: OWSViewController, UITextViewDelegat let contactsManager: OWSContactsManager private(set) var textView: UITextView! - private var sendButton: UIBarButtonItem = { - return UIBarButtonItem(title: NSLocalizedString("SEND_BUTTON_TITLE", - comment: "Label for the send button in the conversation view."), - style: .plain, - target: self, - action: #selector(sendPressed)) - }() + private var sendButton: UIBarButtonItem! // MARK: Initializers @@ -52,10 +46,16 @@ public class MessageApprovalViewController: OWSViewController, UITextViewDelegat override public func viewDidLoad() { super.viewDidLoad() + self.navigationItem.title = NSLocalizedString("MESSAGE_APPROVAL_DIALOG_TITLE", comment: "Title for the 'message approval' dialog.") self.navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .stop, target: self, action: #selector(cancelPressed)) + sendButton = UIBarButtonItem(title: NSLocalizedString("SEND_BUTTON_TITLE", + comment: "Label for the send button in the conversation view."), + style: .plain, + target: self, + action: #selector(sendPressed)) self.navigationItem.rightBarButtonItem = sendButton } @@ -63,6 +63,12 @@ public class MessageApprovalViewController: OWSViewController, UITextViewDelegat sendButton.isEnabled = textView.text.count > 0 } + override public func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + + updateSendButton() + } + // MARK: - Create Views public override func loadView() { diff --git a/SignalServiceKit/src/Messages/OWSMessageSender.m b/SignalServiceKit/src/Messages/OWSMessageSender.m index f001f4d8e..90f0659e3 100644 --- a/SignalServiceKit/src/Messages/OWSMessageSender.m +++ b/SignalServiceKit/src/Messages/OWSMessageSender.m @@ -976,7 +976,7 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException"; messages:deviceMessages relay:recipient.relay timeStamp:message.timestamp]; - if (TSSocketManager.sharedManager.canMakeRequests) { + if (CurrentAppContext().isMainApp && TSSocketManager.sharedManager.canMakeRequests) { [TSSocketManager.sharedManager makeRequest:request success:^(id _Nullable responseObject) { [self messageSendDidSucceed:message