no message

This commit is contained in:
overtake 2020-09-11 17:26:45 +03:00
parent 754504403c
commit 5066fe42d4
2 changed files with 3 additions and 3 deletions

View File

@ -78,7 +78,7 @@ public func updateGroupDiscussionForChannel(network: Network, postbox: Postbox,
previousGroupId = current.linkedDiscussionPeerId
return current.withUpdatedLinkedDiscussionPeerId(.known(groupId))
})
if case let .known(maybeValue) = previousGroupId, let value = maybeValue, value != groupId {
if case let .known(maybeValue)? = previousGroupId, let value = maybeValue, value != groupId {
transaction.updatePeerCachedData(peerIds: Set([value]), update: { (_, current) -> CachedPeerData? in
let cachedData = (current as? CachedChannelData ?? CachedChannelData())
return cachedData.withUpdatedLinkedDiscussionPeerId(.known(nil))
@ -92,7 +92,7 @@ public func updateGroupDiscussionForChannel(network: Network, postbox: Postbox,
previousChannelId = current.linkedDiscussionPeerId
return current.withUpdatedLinkedDiscussionPeerId(.known(channelId))
})
if case let .known(maybeValue) = previousChannelId, let value = maybeValue, value != channelId {
if case let .known(maybeValue)? = previousChannelId, let value = maybeValue, value != channelId {
transaction.updatePeerCachedData(peerIds: Set([value]), update: { (_, current) -> CachedPeerData? in
let cachedData = (current as? CachedChannelData ?? CachedChannelData())
return cachedData.withUpdatedLinkedDiscussionPeerId(.known(nil))

View File

@ -121,7 +121,7 @@ public func requestPeerPhotos(postbox: Postbox, network: Network, peerId: PeerId
switch media.action {
case let .photoUpdated(image):
if let image = image {
photos.append(TelegramPeerPhoto(image: image, reference: nil, date: message.timestamp, index: index, totalCount: messages.count, messageId: message.id))
photos.append(TelegramPeerPhoto(image: image, reference: image.reference, date: message.timestamp, index: index, totalCount: messages.count, messageId: message.id))
}
default:
break