From eaeef3080ad022d7719081bc8b2869e8156e522d Mon Sep 17 00:00:00 2001 From: iequidoo Date: Fri, 20 Dec 2024 16:50:27 -0300 Subject: [PATCH] docs: That Viewtype::Sticker may be changed to Image and how to disable that (#6352) --- deltachat-ffi/deltachat.h | 2 ++ deltachat-jsonrpc/src/api/types/message.rs | 3 +++ src/message.rs | 3 +++ 3 files changed, 8 insertions(+) diff --git a/deltachat-ffi/deltachat.h b/deltachat-ffi/deltachat.h index 805b88849f..edff3dfb21 100644 --- a/deltachat-ffi/deltachat.h +++ b/deltachat-ffi/deltachat.h @@ -5393,6 +5393,8 @@ int64_t dc_lot_get_timestamp (const dc_lot_t* lot); /** * Message containing a sticker, similar to image. + * NB: When sending, the message viewtype may be changed to `Image` by some heuristics like checking + * for transparent pixels. * If possible, the UI should display the image without borders in a transparent way. * A click on a sticker will offer to install the sticker set in some future. */ diff --git a/deltachat-jsonrpc/src/api/types/message.rs b/deltachat-jsonrpc/src/api/types/message.rs index 72767ebd9b..c2ca8fe7b4 100644 --- a/deltachat-jsonrpc/src/api/types/message.rs +++ b/deltachat-jsonrpc/src/api/types/message.rs @@ -273,6 +273,9 @@ pub enum MessageViewtype { Gif, /// Message containing a sticker, similar to image. + /// NB: When sending, the message viewtype may be changed to `Image` by some heuristics like + /// checking for transparent pixels. Use `Message::force_sticker()` to disable them. + /// /// If possible, the ui should display the image without borders in a transparent way. /// A click on a sticker will offer to install the sticker set in some future. Sticker, diff --git a/src/message.rs b/src/message.rs index f7467b009d..ccd22fefe8 100644 --- a/src/message.rs +++ b/src/message.rs @@ -2094,6 +2094,9 @@ pub enum Viewtype { Gif = 21, /// Message containing a sticker, similar to image. + /// NB: When sending, the message viewtype may be changed to `Image` by some heuristics like + /// checking for transparent pixels. Use `Message::force_sticker()` to disable them. + /// /// If possible, the ui should display the image without borders in a transparent way. /// A click on a sticker will offer to install the sticker set in some future. Sticker = 23,