Update API [skip ci]

This commit is contained in:
Ilya Laktyushin
2022-12-08 23:21:16 +04:00
parent d631dcb626
commit c6dc8c9e56
7 changed files with 59 additions and 24 deletions

View File

@@ -148,7 +148,7 @@ func applyUpdateMessage(postbox: Postbox, stateManager: AccountStateManager, mes
text = updatedMessage.text
forwardInfo = updatedMessage.forwardInfo
} else if case let .updateShortSentMessage(_, _, _, _, _, apiMedia, entities, ttlPeriod) = result {
let (mediaValue, _, nonPremium) = textMediaAndExpirationTimerFromApiMedia(apiMedia, currentMessage.id.peerId)
let (mediaValue, _, nonPremium, hasSpoiler) = textMediaAndExpirationTimerFromApiMedia(apiMedia, currentMessage.id.peerId)
if let mediaValue = mediaValue {
media = [mediaValue]
} else {
@@ -176,6 +176,10 @@ func applyUpdateMessage(postbox: Postbox, stateManager: AccountStateManager, mes
updatedAttributes.append(NonPremiumMessageAttribute())
}
if let hasSpoiler = hasSpoiler, hasSpoiler {
updatedAttributes.append(MediaSpoilerMessageAttribute())
}
if Namespaces.Message.allScheduled.contains(message.id.namespace) && updatedId.namespace == Namespaces.Message.Cloud {
for i in 0 ..< updatedAttributes.count {
if updatedAttributes[i] is OutgoingScheduleInfoMessageAttribute {