diff --git a/deltachat-jsonrpc/src/api/types/chat.rs b/deltachat-jsonrpc/src/api/types/chat.rs index 233e29a87..9c3c4cd98 100644 --- a/deltachat-jsonrpc/src/api/types/chat.rs +++ b/deltachat-jsonrpc/src/api/types/chat.rs @@ -32,6 +32,7 @@ pub struct FullChat { is_protected: bool, profile_image: Option, //BLOBS ? archived: bool, + pinned: bool, // subtitle - will be moved to frontend because it uses translation functions chat_type: u32, is_unpromoted: bool, @@ -104,6 +105,7 @@ impl FullChat { is_protected: chat.is_protected(), profile_image, //BLOBS ? archived: chat.get_visibility() == chat::ChatVisibility::Archived, + pinned: chat.get_visibility() == chat::ChatVisibility::Pinned, chat_type: chat.get_type().to_u32().context("unknown chat type id")?, is_unpromoted: chat.is_unpromoted(), is_self_talk: chat.is_self_talk(), @@ -153,6 +155,7 @@ pub struct BasicChat { is_protected: bool, profile_image: Option, //BLOBS ? archived: bool, + pinned: bool, chat_type: u32, is_unpromoted: bool, is_self_talk: bool, @@ -180,6 +183,7 @@ impl BasicChat { is_protected: chat.is_protected(), profile_image, //BLOBS ? archived: chat.get_visibility() == chat::ChatVisibility::Archived, + pinned: chat.get_visibility() == chat::ChatVisibility::Pinned, chat_type: chat.get_type().to_u32().context("unknown chat type id")?, is_unpromoted: chat.is_unpromoted(), is_self_talk: chat.is_self_talk(), diff --git a/deltachat-rpc-client/tests/test_chatlist_events.py b/deltachat-rpc-client/tests/test_chatlist_events.py index 85c06c31b..981d4c8d7 100644 --- a/deltachat-rpc-client/tests/test_chatlist_events.py +++ b/deltachat-rpc-client/tests/test_chatlist_events.py @@ -210,6 +210,7 @@ def test_multidevice_sync_chat(acfactory: ACFactory) -> None: alice_second_device.clear_all_events() alice_chat_bob.pin() wait_for_chatlist_specific_item(alice_second_device, alice_chat_bob.id) + assert alice_second_device.get_chat_by_id(alice_chat_bob.id).get_basic_snapshot().pinned alice_second_device.clear_all_events() alice_chat_bob.mute()