Skip to content

Commit 0142515

Browse files
authored
api!: In ChatListItem, replace is_group and is_(out_)broadcast with chat_type property (#7003)
- removed ChatListItem.is_broadcast - mark ChatListItem.is_group as deprecated
1 parent d45ec7f commit 0142515

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

deltachat-jsonrpc/src/api/types/chat_list.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pub enum ChatListItemFetchResult {
2323
name: String,
2424
avatar_path: Option<String>,
2525
color: String,
26+
chat_type: u32,
2627
last_updated: Option<i64>,
2728
summary_text1: String,
2829
summary_text2: String,
@@ -54,6 +55,7 @@ pub enum ChatListItemFetchResult {
5455
///
5556
/// See also `is_key_contact` on `Contact`.
5657
is_encrypted: bool,
58+
/// deprecated 2025-07, use chat_type instead
5759
is_group: bool,
5860
fresh_message_counter: usize,
5961
is_self_talk: bool,
@@ -64,10 +66,6 @@ pub enum ChatListItemFetchResult {
6466
is_pinned: bool,
6567
is_muted: bool,
6668
is_contact_request: bool,
67-
/// Deprecated 2025-07, alias for is_out_broadcast
68-
is_broadcast: bool,
69-
/// true if the chat type is OutBroadcast
70-
is_out_broadcast: bool,
7169
/// contact id if this is a dm chat (for view profile entry in context menu)
7270
dm_chat_contact: Option<u32>,
7371
was_seen_recently: bool,
@@ -157,6 +155,7 @@ pub(crate) async fn get_chat_list_item_by_id(
157155
name: chat.get_name().to_owned(),
158156
avatar_path,
159157
color,
158+
chat_type: chat.get_type().to_u32().context("unknown chat type id")?,
160159
last_updated,
161160
summary_text1,
162161
summary_text2,
@@ -174,8 +173,6 @@ pub(crate) async fn get_chat_list_item_by_id(
174173
is_pinned: visibility == ChatVisibility::Pinned,
175174
is_muted: chat.is_muted(),
176175
is_contact_request: chat.is_contact_request(),
177-
is_broadcast: chat.get_type() == Chattype::OutBroadcast,
178-
is_out_broadcast: chat.get_type() == Chattype::OutBroadcast,
179176
dm_chat_contact,
180177
was_seen_recently,
181178
last_message_type: message_type,

0 commit comments

Comments
 (0)