|
|
|
@ -36,11 +36,15 @@ class DebugUINotifications: DebugUIPage {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var sectionItems = [
|
|
|
|
|
OWSTableItem(title:"Last Incoming Message") {
|
|
|
|
|
Logger.info("\(self.logTag) scheduling notification for incoming message.")
|
|
|
|
|
self.delayedNotificationDispatch {
|
|
|
|
|
Logger.info("\(self.logTag) dispatching")
|
|
|
|
|
TSStorageManager.shared().newDatabaseConnection().read({ (transaction) in
|
|
|
|
|
OWSTableItem(title:"Last Incoming Message") { [weak self] in
|
|
|
|
|
guard let strongSelf = self else {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Logger.info("\(strongSelf.logTag) scheduling notification for incoming message.")
|
|
|
|
|
strongSelf.delayedNotificationDispatch {
|
|
|
|
|
Logger.info("\(strongSelf.logTag) dispatching")
|
|
|
|
|
TSStorageManager.shared().newDatabaseConnection().read { (transaction) in
|
|
|
|
|
guard let viewTransaction = transaction.ext(TSMessageDatabaseViewExtensionName) as? YapDatabaseViewTransaction else {
|
|
|
|
|
owsFail("unable to build view transaction")
|
|
|
|
|
return
|
|
|
|
@ -55,28 +59,40 @@ class DebugUINotifications: DebugUIPage {
|
|
|
|
|
owsFail("last message was not an incoming message.")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
Logger.info("\(self.logTag) notifying user of incoming message")
|
|
|
|
|
self.notificationsManager.notifyUser(for: incomingMessage, in: thread, contactsManager: self.contactsManager, transaction: transaction)
|
|
|
|
|
})
|
|
|
|
|
Logger.info("\(strongSelf.logTag) notifying user of incoming message")
|
|
|
|
|
strongSelf.notificationsManager.notifyUser(for: incomingMessage, in: thread, contactsManager: strongSelf.contactsManager, transaction: transaction)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
if let contactThread = thread as? TSContactThread {
|
|
|
|
|
sectionItems += [
|
|
|
|
|
OWSTableItem(title:"Call Missed") {
|
|
|
|
|
self.delayedNotificationDispatchWithFakeCall(thread: contactThread) { call in
|
|
|
|
|
self.notificationsAdapter.presentMissedCall(call, callerName: thread.name())
|
|
|
|
|
OWSTableItem(title:"Call Missed") { [weak self] in
|
|
|
|
|
guard let strongSelf = self else {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
strongSelf.delayedNotificationDispatchWithFakeCall(thread: contactThread) { call in
|
|
|
|
|
strongSelf.notificationsAdapter.presentMissedCall(call, callerName: thread.name())
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
OWSTableItem(title:"Call Rejected: New Safety Number") {
|
|
|
|
|
self.delayedNotificationDispatchWithFakeCall(thread: contactThread) { call in
|
|
|
|
|
self.notificationsAdapter.presentMissedCallBecauseOfNewIdentity(call: call, callerName: thread.name())
|
|
|
|
|
OWSTableItem(title:"Call Rejected: New Safety Number") { [weak self] in
|
|
|
|
|
guard let strongSelf = self else {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
strongSelf.delayedNotificationDispatchWithFakeCall(thread: contactThread) { call in
|
|
|
|
|
strongSelf.notificationsAdapter.presentMissedCallBecauseOfNewIdentity(call: call, callerName: thread.name())
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
OWSTableItem(title:"Call Rejected: No Longer Verified") {
|
|
|
|
|
self.delayedNotificationDispatchWithFakeCall(thread: contactThread) { call in
|
|
|
|
|
self.notificationsAdapter.presentMissedCallBecauseOfNoLongerVerifiedIdentity(call: call, callerName: thread.name())
|
|
|
|
|
OWSTableItem(title:"Call Rejected: No Longer Verified") { [weak self] in
|
|
|
|
|
guard let strongSelf = self else {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
strongSelf.delayedNotificationDispatchWithFakeCall(thread: contactThread) { call in
|
|
|
|
|
strongSelf.notificationsAdapter.presentMissedCallBecauseOfNoLongerVerifiedIdentity(call: call, callerName: thread.name())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|