api: Contact::get_all(): Support listing address-contacts

Also test-cover `DC_GCL_ADD_SELF`.
This commit is contained in:
iequidoo
2025-06-29 17:24:06 -03:00
committed by iequidoo
parent 0a73c2b7ab
commit 7e4d4cf680
6 changed files with 62 additions and 16 deletions

View File

@@ -1505,6 +1505,14 @@ impl CommandApi {
Ok(contacts)
}
/// Returns ids of known and unblocked contacts.
///
/// By default, key-contacts are listed.
///
/// * `list_flags` - A combination of flags:
/// - `DC_GCL_ADD_SELF` - Add SELF unless filtered by other parameters.
/// - `DC_GCL_ADDRESS` - List address-contacts instead of key-contacts.
/// * `query` - A string to filter the list.
async fn get_contact_ids(
&self,
account_id: u32,
@@ -1516,8 +1524,10 @@ impl CommandApi {
Ok(contacts.into_iter().map(|c| c.to_u32()).collect())
}
/// Get a list of contacts.
/// (formerly called getContacts2 in desktop)
/// Returns known and unblocked contacts.
///
/// Formerly called `getContacts2` in Desktop.
/// See [`Self::get_contact_ids`] for parameters and more info.
async fn get_contacts(
&self,
account_id: u32,