api(json-rpc): force stickers to be sent as stickers (#4819)

This approach uses a param field to enable forcing the sticker
`viewtype`. The first commit has the memory-only flag implemented, but
this flag is not persistent through the database conversion needed for
draft/undraft. That's why `param` has to be used.

follow up to #4814 
fixes #4739

---------

Co-authored-by: Septias <scoreplayer2000@gmail.comclear>
This commit is contained in:
Sebastian Klähn
2023-10-14 10:34:46 +02:00
committed by GitHub
parent 2775fd1fcf
commit 0751cc50b9
4 changed files with 61 additions and 1 deletions

View File

@@ -1756,6 +1756,9 @@ impl CommandApi {
let mut msg = Message::new(Viewtype::Sticker);
msg.set_file(&sticker_path, None);
// JSON-rpc does not need heuristics to turn [Viewtype::Sticker] into [Viewtype::Image]
msg.force_sticker();
let message_id = deltachat::chat::send_msg(&ctx, ChatId::new(chat_id), &mut msg).await?;
Ok(message_id.to_u32())
}