Emoji improvements

This commit is contained in:
Ali
2022-07-22 23:30:46 +02:00
parent 7b663a3445
commit 61b47ada27
34 changed files with 484 additions and 206 deletions

View File

@@ -740,6 +740,14 @@ public final class Transaction {
return Set()
}
public func filterStoredMediaIds(namespace: MediaId.Namespace, ids: Set<Int64>) -> Set<Int64> {
assert(!self.disposed)
if let postbox = self.postbox {
return postbox.filterStoredMediaIds(namespace: namespace, ids: ids)
}
return Set()
}
public func storedMessageId(peerId: PeerId, namespace: MessageId.Namespace, timestamp: Int32) -> MessageId? {
assert(!self.disposed)
return self.postbox?.storedMessageId(peerId: peerId, namespace: namespace, timestamp: timestamp)
@@ -2352,6 +2360,18 @@ final class PostboxImpl {
return filteredIds
}
fileprivate func filterStoredMediaIds(namespace: MediaId.Namespace, ids: Set<Int64>) -> Set<Int64> {
var filteredIds = Set<Int64>()
for id in ids {
if !self.mediaTable.exists(id: MediaId(namespace: namespace, id: id)) {
filteredIds.insert(id)
}
}
return filteredIds
}
fileprivate func storedMessageId(peerId: PeerId, namespace: MessageId.Namespace, timestamp: Int32) -> MessageId? {
if let id = self.messageHistoryTable.findMessageId(peerId: peerId, namespace: namespace, timestamp: timestamp), id.namespace == namespace {
return id