mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Roll back some refreshDueToExternalTransaction implementations
This commit is contained in:
parent
37148c70d4
commit
0679e4dd7e
@ -204,7 +204,7 @@ final class MutableGlobalMessageTagsView: MutablePostboxView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
||||||
let (entries, lower, upper) = postbox.messageHistoryTable.entriesAround(globalTagMask: globalTag, index: position, count: count)
|
/*let (entries, lower, upper) = postbox.messageHistoryTable.entriesAround(globalTagMask: globalTag, index: position, count: count)
|
||||||
|
|
||||||
self.entries = entries.map { entry -> InternalGlobalMessageTagsEntry in
|
self.entries = entries.map { entry -> InternalGlobalMessageTagsEntry in
|
||||||
switch entry {
|
switch entry {
|
||||||
@ -219,7 +219,8 @@ final class MutableGlobalMessageTagsView: MutablePostboxView {
|
|||||||
|
|
||||||
self.render(postbox: postbox)
|
self.render(postbox: postbox)
|
||||||
|
|
||||||
return true
|
return true*/
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
private func add(_ entry: InternalGlobalMessageTagsEntry) -> Bool {
|
private func add(_ entry: InternalGlobalMessageTagsEntry) -> Bool {
|
||||||
|
@ -63,7 +63,7 @@ final class MutableHistoryTagInfoView: MutablePostboxView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
||||||
var currentIndex: MessageIndex?
|
/*var currentIndex: MessageIndex?
|
||||||
for namespace in postbox.messageHistoryIndexTable.existingNamespaces(peerId: self.peerId) {
|
for namespace in postbox.messageHistoryIndexTable.existingNamespaces(peerId: self.peerId) {
|
||||||
if let index = postbox.messageHistoryTagsTable.latestIndex(tag: self.tag, peerId: self.peerId, namespace: namespace) {
|
if let index = postbox.messageHistoryTagsTable.latestIndex(tag: self.tag, peerId: self.peerId, namespace: namespace) {
|
||||||
currentIndex = index
|
currentIndex = index
|
||||||
@ -75,7 +75,8 @@ final class MutableHistoryTagInfoView: MutablePostboxView {
|
|||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}*/
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func immutableView() -> PostboxView {
|
func immutableView() -> PostboxView {
|
||||||
|
@ -39,7 +39,7 @@ final class MutableInvalidatedMessageHistoryTagSummariesView: MutablePostboxView
|
|||||||
}
|
}
|
||||||
|
|
||||||
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
||||||
var entries = Set<InvalidatedMessageHistoryTagsSummaryEntry>()
|
/*var entries = Set<InvalidatedMessageHistoryTagsSummaryEntry>()
|
||||||
for entry in postbox.invalidatedMessageHistoryTagsSummaryTable.get(tagMask: tagMask, namespace: namespace) {
|
for entry in postbox.invalidatedMessageHistoryTagsSummaryTable.get(tagMask: tagMask, namespace: namespace) {
|
||||||
entries.insert(entry)
|
entries.insert(entry)
|
||||||
}
|
}
|
||||||
@ -48,7 +48,8 @@ final class MutableInvalidatedMessageHistoryTagSummariesView: MutablePostboxView
|
|||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}*/
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func immutableView() -> PostboxView {
|
func immutableView() -> PostboxView {
|
||||||
|
@ -42,7 +42,7 @@ final class MutableItemCollectionIdsView: MutablePostboxView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
||||||
var idsByNamespace: [ItemCollectionId.Namespace: Set<ItemCollectionId>] = [:]
|
/*var idsByNamespace: [ItemCollectionId.Namespace: Set<ItemCollectionId>] = [:]
|
||||||
for namespace in namespaces {
|
for namespace in namespaces {
|
||||||
let ids = postbox.itemCollectionInfoTable.getIds(namespace: namespace)
|
let ids = postbox.itemCollectionInfoTable.getIds(namespace: namespace)
|
||||||
idsByNamespace[namespace] = Set(ids)
|
idsByNamespace[namespace] = Set(ids)
|
||||||
@ -52,7 +52,8 @@ final class MutableItemCollectionIdsView: MutablePostboxView {
|
|||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}*/
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func immutableView() -> PostboxView {
|
func immutableView() -> PostboxView {
|
||||||
|
@ -27,13 +27,14 @@ final class MutableMessageHistoryTagSummaryView: MutablePostboxView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
||||||
let count = postbox.messageHistoryTagsSummaryTable.get(MessageHistoryTagsSummaryKey(tag: self.tag, peerId: self.peerId, namespace: self.namespace))?.count
|
/*let count = postbox.messageHistoryTagsSummaryTable.get(MessageHistoryTagsSummaryKey(tag: self.tag, peerId: self.peerId, namespace: self.namespace))?.count
|
||||||
if self.count != count {
|
if self.count != count {
|
||||||
self.count = count
|
self.count = count
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}*/
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func immutableView() -> PostboxView {
|
func immutableView() -> PostboxView {
|
||||||
|
@ -19,13 +19,14 @@ final class MutablePeerChatStateView: MutablePostboxView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
||||||
let chatState = postbox.peerChatStateTable.get(self.peerId)
|
/*let chatState = postbox.peerChatStateTable.get(self.peerId)
|
||||||
if self.chatState != chatState {
|
if self.chatState != chatState {
|
||||||
self.chatState = chatState
|
self.chatState = chatState
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}*/
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func immutableView() -> PostboxView {
|
func immutableView() -> PostboxView {
|
||||||
|
@ -21,13 +21,14 @@ final class MutablePeerNotificationSettingsBehaviorTimestampView: MutablePostbox
|
|||||||
}
|
}
|
||||||
|
|
||||||
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
||||||
let earliestTimestamp = postbox.peerNotificationSettingsBehaviorTable.getEarliest()?.1
|
/*let earliestTimestamp = postbox.peerNotificationSettingsBehaviorTable.getEarliest()?.1
|
||||||
if self.earliestTimestamp != earliestTimestamp {
|
if self.earliestTimestamp != earliestTimestamp {
|
||||||
self.earliestTimestamp = earliestTimestamp
|
self.earliestTimestamp = earliestTimestamp
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}*/
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func immutableView() -> PostboxView {
|
func immutableView() -> PostboxView {
|
||||||
|
@ -38,7 +38,7 @@ final class MutablePeerNotificationSettingsView: MutablePostboxView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
||||||
var notificationSettings: [PeerId: PeerNotificationSettings] = [:]
|
/*var notificationSettings: [PeerId: PeerNotificationSettings] = [:]
|
||||||
for peerId in self.peerIds {
|
for peerId in self.peerIds {
|
||||||
var notificationPeerId = peerId
|
var notificationPeerId = peerId
|
||||||
if let peer = postbox.peerTable.get(peerId), let associatedPeerId = peer.associatedPeerId {
|
if let peer = postbox.peerTable.get(peerId), let associatedPeerId = peer.associatedPeerId {
|
||||||
@ -71,7 +71,8 @@ final class MutablePeerNotificationSettingsView: MutablePostboxView {
|
|||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}*/
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func immutableView() -> PostboxView {
|
func immutableView() -> PostboxView {
|
||||||
|
@ -28,7 +28,7 @@ final class MutablePeerPresencesView: MutablePostboxView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
||||||
var presences: [PeerId: PeerPresence] = [:]
|
/*var presences: [PeerId: PeerPresence] = [:]
|
||||||
|
|
||||||
for id in self.ids {
|
for id in self.ids {
|
||||||
if let presence = postbox.peerPresenceTable.get(id) {
|
if let presence = postbox.peerPresenceTable.get(id) {
|
||||||
@ -58,7 +58,8 @@ final class MutablePeerPresencesView: MutablePostboxView {
|
|||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}*/
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func immutableView() -> PostboxView {
|
func immutableView() -> PostboxView {
|
||||||
|
@ -46,7 +46,7 @@ final class MutablePreferencesView: MutablePostboxView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
||||||
var values: [ValueBoxKey: PreferencesEntry] = [:]
|
/*var values: [ValueBoxKey: PreferencesEntry] = [:]
|
||||||
for key in self.keys {
|
for key in self.keys {
|
||||||
if let value = postbox.preferencesTable.get(key: key) {
|
if let value = postbox.preferencesTable.get(key: key) {
|
||||||
values[key] = value
|
values[key] = value
|
||||||
@ -57,7 +57,8 @@ final class MutablePreferencesView: MutablePostboxView {
|
|||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}*/
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func immutableView() -> PostboxView {
|
func immutableView() -> PostboxView {
|
||||||
|
@ -28,13 +28,14 @@ final class MutableSynchronizeGroupMessageStatsView: MutablePostboxView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
||||||
let groupsAndNamespaces = postbox.synchronizeGroupMessageStatsTable.get()
|
/*let groupsAndNamespaces = postbox.synchronizeGroupMessageStatsTable.get()
|
||||||
if self.groupsAndNamespaces != groupsAndNamespaces {
|
if self.groupsAndNamespaces != groupsAndNamespaces {
|
||||||
self.groupsAndNamespaces = groupsAndNamespaces
|
self.groupsAndNamespaces = groupsAndNamespaces
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}*/
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func immutableView() -> PostboxView {
|
func immutableView() -> PostboxView {
|
||||||
|
@ -31,7 +31,7 @@ final class MutableTopChatMessageView: MutablePostboxView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
|
||||||
var messages: [PeerId: Message] = [:]
|
/*var messages: [PeerId: Message] = [:]
|
||||||
|
|
||||||
for peerId in self.peerIds {
|
for peerId in self.peerIds {
|
||||||
if let index = postbox.chatListIndexTable.get(peerId: peerId).topMessageIndex {
|
if let index = postbox.chatListIndexTable.get(peerId: peerId).topMessageIndex {
|
||||||
@ -62,7 +62,8 @@ final class MutableTopChatMessageView: MutablePostboxView {
|
|||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}*/
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func immutableView() -> PostboxView {
|
func immutableView() -> PostboxView {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user