Calendar improvements

This commit is contained in:
Ali
2021-10-06 01:41:25 +04:00
parent b1d4e7f259
commit a8940ebf68
23 changed files with 1604 additions and 98 deletions

View File

@@ -2693,6 +2693,13 @@ final class MessageHistoryTable: Table {
return nil
}
}
func firstMessageInRange(peerId: PeerId, namespace: MessageId.Namespace, tag: MessageTags, timestampMax: Int32, timestampMin: Int32) -> IntermediateMessage? {
guard let index = self.tagsTable.earlierIndices(tag: tag, peerId: peerId, namespace: namespace, index: MessageIndex(id: MessageId(peerId: peerId, namespace: namespace, id: 1), timestamp: timestampMax), includeFrom: true, minIndex: MessageIndex(id: MessageId(peerId: peerId, namespace: namespace, id: 1), timestamp: timestampMin), count: 1).first else {
return nil
}
return self.getMessage(index)
}
func incomingMessageStatsInIndices(_ peerId: PeerId, namespace: MessageId.Namespace, indices: [MessageIndex]) -> (Int, Bool) {
var count: Int = 0