|
@@ -268,7 +268,7 @@ class ChatViewController: UITableViewController {
|
|
|
|
|
|
// things that do not affect the chatview
|
|
|
// and are delayed after the view is displayed
|
|
|
- DispatchQueue.main.async { [weak self] in
|
|
|
+ DispatchQueue.global(qos: .background).async { [weak self] in
|
|
|
guard let self = self else { return }
|
|
|
self.dcContext.marknoticedChat(chatId: self.chatId)
|
|
|
}
|
|
@@ -397,7 +397,7 @@ class ChatViewController: UITableViewController {
|
|
|
if let indexPaths = tableView.indexPathsForVisibleRows {
|
|
|
let visibleMessagesIds = indexPaths.map { UInt32(messageIds[$0.row]) }
|
|
|
if !visibleMessagesIds.isEmpty {
|
|
|
- DispatchQueue.main.async { [weak self] in
|
|
|
+ DispatchQueue.global(qos: .background).async { [weak self] in
|
|
|
self?.dcContext.markSeenMessages(messageIds: visibleMessagesIds)
|
|
|
}
|
|
|
}
|
|
@@ -865,7 +865,7 @@ class ChatViewController: UITableViewController {
|
|
|
|
|
|
func updateMessage(_ messageId: Int) {
|
|
|
if messageIds.firstIndex(where: { $0 == messageId }) != nil {
|
|
|
- DispatchQueue.main.async { [weak self] in
|
|
|
+ DispatchQueue.global(qos: .background).async { [weak self] in
|
|
|
self?.dcContext.markSeenMessages(messageIds: [UInt32(messageId)])
|
|
|
}
|
|
|
let wasLastSectionVisible = self.isLastRowVisible()
|
|
@@ -882,7 +882,7 @@ class ChatViewController: UITableViewController {
|
|
|
}
|
|
|
|
|
|
func insertMessage(_ message: DcMsg) {
|
|
|
- DispatchQueue.main.async { [weak self] in
|
|
|
+ DispatchQueue.global(qos: .background).async { [weak self] in
|
|
|
self?.dcContext.markSeenMessages(messageIds: [UInt32(message.id)])
|
|
|
}
|
|
|
messageIds.append(message.id)
|