mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
[WIP] Quick replies
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SwiftSignalKit
|
||||
|
||||
public enum ViewUpdateType : Equatable {
|
||||
public enum ViewUpdateType: Equatable {
|
||||
case Initial
|
||||
case InitialUnread(MessageIndex)
|
||||
case Generic
|
||||
@@ -351,10 +351,6 @@ final class ViewTracker {
|
||||
|
||||
self.updateTrackedChatListHoles()
|
||||
|
||||
if updateTrackedHoles {
|
||||
self.updateTrackedHoles()
|
||||
}
|
||||
|
||||
if self.unsentMessageView.replay(transaction.unsentMessageOperations) {
|
||||
self.unsentViewUpdated()
|
||||
}
|
||||
@@ -414,9 +410,14 @@ final class ViewTracker {
|
||||
}
|
||||
|
||||
for (mutableView, pipe) in self.combinedViews.copyItems() {
|
||||
if mutableView.replay(postbox: postbox, transaction: transaction) {
|
||||
let result = mutableView.replay(postbox: postbox, transaction: transaction)
|
||||
|
||||
if result.updated {
|
||||
pipe.putNext(mutableView.immutableView())
|
||||
}
|
||||
if result.updateTrackedHoles {
|
||||
updateTrackedHoles = true
|
||||
}
|
||||
}
|
||||
|
||||
for (view, pipe) in self.failedMessageIdsViews.copyItems() {
|
||||
@@ -425,6 +426,10 @@ final class ViewTracker {
|
||||
}
|
||||
}
|
||||
|
||||
if updateTrackedHoles {
|
||||
self.updateTrackedHoles()
|
||||
}
|
||||
|
||||
self.updateTrackedForumTopicListHoles()
|
||||
}
|
||||
|
||||
@@ -486,6 +491,26 @@ final class ViewTracker {
|
||||
firstHolesAndTags.insert(MessageHistoryHolesViewEntry(hole: hole, direction: direction, space: space, count: count, userId: userId))
|
||||
}
|
||||
}
|
||||
for (view, _) in self.combinedViews.copyItems() {
|
||||
for (_, subview) in view.views {
|
||||
if let subview = subview as? MutableMessageHistoryView {
|
||||
if let (hole, direction, count, userId) = subview.firstHole() {
|
||||
let space: MessageHistoryHoleOperationSpace
|
||||
if let tag = subview.tag {
|
||||
switch tag {
|
||||
case let .tag(value):
|
||||
space = .tag(value)
|
||||
case let .customTag(value, regularTag):
|
||||
space = .customTag(value, regularTag)
|
||||
}
|
||||
} else {
|
||||
space = .everywhere
|
||||
}
|
||||
firstHolesAndTags.insert(MessageHistoryHolesViewEntry(hole: hole, direction: direction, space: space, count: count, userId: userId))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if self.messageHistoryHolesView.update(firstHolesAndTags) {
|
||||
for subscriber in self.messageHistoryHolesViewSubscribers.copyItems() {
|
||||
|
||||
Reference in New Issue
Block a user