mirror of
https://github.com/chatmail/core.git
synced 2026-05-22 16:26:31 +03:00
api(deltachat-jsonrpc): add pinned property to FullChat and BasicChat
This commit is contained in:
@@ -32,6 +32,7 @@ pub struct FullChat {
|
|||||||
is_protected: bool,
|
is_protected: bool,
|
||||||
profile_image: Option<String>, //BLOBS ?
|
profile_image: Option<String>, //BLOBS ?
|
||||||
archived: bool,
|
archived: bool,
|
||||||
|
pinned: bool,
|
||||||
// subtitle - will be moved to frontend because it uses translation functions
|
// subtitle - will be moved to frontend because it uses translation functions
|
||||||
chat_type: u32,
|
chat_type: u32,
|
||||||
is_unpromoted: bool,
|
is_unpromoted: bool,
|
||||||
@@ -104,6 +105,7 @@ impl FullChat {
|
|||||||
is_protected: chat.is_protected(),
|
is_protected: chat.is_protected(),
|
||||||
profile_image, //BLOBS ?
|
profile_image, //BLOBS ?
|
||||||
archived: chat.get_visibility() == chat::ChatVisibility::Archived,
|
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")?,
|
chat_type: chat.get_type().to_u32().context("unknown chat type id")?,
|
||||||
is_unpromoted: chat.is_unpromoted(),
|
is_unpromoted: chat.is_unpromoted(),
|
||||||
is_self_talk: chat.is_self_talk(),
|
is_self_talk: chat.is_self_talk(),
|
||||||
@@ -153,6 +155,7 @@ pub struct BasicChat {
|
|||||||
is_protected: bool,
|
is_protected: bool,
|
||||||
profile_image: Option<String>, //BLOBS ?
|
profile_image: Option<String>, //BLOBS ?
|
||||||
archived: bool,
|
archived: bool,
|
||||||
|
pinned: bool,
|
||||||
chat_type: u32,
|
chat_type: u32,
|
||||||
is_unpromoted: bool,
|
is_unpromoted: bool,
|
||||||
is_self_talk: bool,
|
is_self_talk: bool,
|
||||||
@@ -180,6 +183,7 @@ impl BasicChat {
|
|||||||
is_protected: chat.is_protected(),
|
is_protected: chat.is_protected(),
|
||||||
profile_image, //BLOBS ?
|
profile_image, //BLOBS ?
|
||||||
archived: chat.get_visibility() == chat::ChatVisibility::Archived,
|
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")?,
|
chat_type: chat.get_type().to_u32().context("unknown chat type id")?,
|
||||||
is_unpromoted: chat.is_unpromoted(),
|
is_unpromoted: chat.is_unpromoted(),
|
||||||
is_self_talk: chat.is_self_talk(),
|
is_self_talk: chat.is_self_talk(),
|
||||||
|
|||||||
@@ -210,6 +210,7 @@ def test_multidevice_sync_chat(acfactory: ACFactory) -> None:
|
|||||||
alice_second_device.clear_all_events()
|
alice_second_device.clear_all_events()
|
||||||
alice_chat_bob.pin()
|
alice_chat_bob.pin()
|
||||||
wait_for_chatlist_specific_item(alice_second_device, alice_chat_bob.id)
|
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_second_device.clear_all_events()
|
||||||
alice_chat_bob.mute()
|
alice_chat_bob.mute()
|
||||||
|
|||||||
Reference in New Issue
Block a user