mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Add more logs
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
public struct TimestampBasedMessageAttributesEntry {
|
||||
public struct TimestampBasedMessageAttributesEntry: CustomStringConvertible {
|
||||
public let tag: UInt16
|
||||
public let timestamp: Int32
|
||||
public let messageId: MessageId
|
||||
@@ -8,6 +8,10 @@ public struct TimestampBasedMessageAttributesEntry {
|
||||
public var index: MessageIndex {
|
||||
return MessageIndex(id: self.messageId, timestamp: timestamp)
|
||||
}
|
||||
|
||||
public var description: String {
|
||||
return "(tag: \(self.tag), timestamp: \(self.timestamp), messageId: \(self.messageId))"
|
||||
}
|
||||
}
|
||||
|
||||
enum TimestampBasedMessageAttributesOperation {
|
||||
@@ -53,7 +57,11 @@ final class TimestampBasedMessageAttributesTable: Table {
|
||||
}
|
||||
|
||||
func set(tag: UInt16, id: MessageId, timestamp: Int32, operations: inout [TimestampBasedMessageAttributesOperation]) {
|
||||
if let previousTimestamp = self.indexTable.get(tag: tag, id: id) {
|
||||
let previousTimestamp = self.indexTable.get(tag: tag, id: id)
|
||||
|
||||
postboxLog("TimestampBasedMessageAttributesTable set(tag: \(tag), id: \(id), timestamp: \(timestamp)) previousTimestamp: \(String(describing: previousTimestamp))")
|
||||
|
||||
if let previousTimestamp = previousTimestamp {
|
||||
if previousTimestamp == timestamp {
|
||||
return
|
||||
} else {
|
||||
@@ -67,7 +75,11 @@ final class TimestampBasedMessageAttributesTable: Table {
|
||||
}
|
||||
|
||||
func remove(tag: UInt16, id: MessageId, operations: inout [TimestampBasedMessageAttributesOperation]) {
|
||||
if let previousTimestamp = self.indexTable.get(tag: tag, id: id) {
|
||||
let previousTimestamp = self.indexTable.get(tag: tag, id: id)
|
||||
|
||||
postboxLog("TimestampBasedMessageAttributesTable remove(tag: \(tag), id: \(id)) previousTimestamp: \(String(describing: previousTimestamp))")
|
||||
|
||||
if let previousTimestamp = previousTimestamp {
|
||||
self.valueBox.remove(self.table, key: self.key(tag: tag, timestamp: previousTimestamp, id: id), secure: false)
|
||||
self.indexTable.remove(tag: tag, id: id)
|
||||
operations.append(.remove(TimestampBasedMessageAttributesEntry(tag: tag, timestamp: previousTimestamp, messageId: id)))
|
||||
|
||||
Reference in New Issue
Block a user