mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Merge commit 'cb415abfccadff11e210e797ace8c1b59d74e4f7'
This commit is contained in:
@@ -611,3 +611,26 @@ extension Api.EncryptedMessage {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension Api.InputMedia {
|
||||
func withUpdatedStickers(_ stickers: [Api.InputDocument]?) -> Api.InputMedia {
|
||||
switch self {
|
||||
case let .inputMediaUploadedDocument(flags, file, thumb, mimeType, attributes, _, ttlSeconds):
|
||||
var flags = flags
|
||||
var attributes = attributes
|
||||
if let _ = stickers {
|
||||
flags |= (1 << 0)
|
||||
attributes.append(.documentAttributeHasStickers)
|
||||
}
|
||||
return .inputMediaUploadedDocument(flags: flags, file: file, thumb: thumb, mimeType: mimeType, attributes: attributes, stickers: stickers, ttlSeconds: ttlSeconds)
|
||||
case let .inputMediaUploadedPhoto(flags, file, _, ttlSeconds):
|
||||
var flags = flags
|
||||
if let _ = stickers {
|
||||
flags |= (1 << 0)
|
||||
}
|
||||
return .inputMediaUploadedPhoto(flags: flags, file: file, stickers: stickers, ttlSeconds: ttlSeconds)
|
||||
default:
|
||||
return self
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user