From 2bcbc9ec6b551d719c941bf10ba60ded7fd3db16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jagoda=20=C5=9Al=C4=85zak?= Date: Tue, 21 Jul 2026 10:09:03 +0200 Subject: [PATCH] WIP: refactor: Unify naming of direct/single/1:1 chats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit draft Closes: #8368 Signed-off-by: Jagoda Ślązak --- README.md | 4 +- deltachat-ffi/deltachat.h | 40 +++++----- deltachat-jsonrpc/src/api.rs | 4 +- deltachat-jsonrpc/src/api/types/chat.rs | 8 +- deltachat-jsonrpc/src/api/types/chat_list.rs | 2 +- deltachat-jsonrpc/src/api/types/message.rs | 4 +- .../typescript/scripts/generate-constants.js | 4 +- deltachat-repl/src/cmdline.rs | 4 +- .../src/deltachat_rpc_client/contact.py | 2 +- python/src/deltachat/account.py | 2 +- python/src/deltachat/chat.py | 8 +- python/src/deltachat/contact.py | 2 +- python/src/deltachat/message.py | 2 +- src/calls.rs | 4 +- src/chat.rs | 70 ++++++++--------- src/chat/chat_tests.rs | 46 +++++------ src/chatlist.rs | 20 ++--- src/constants.rs | 6 +- src/contact.rs | 8 +- src/contact/contact_tests.rs | 2 +- src/context/context_tests.rs | 2 +- src/ephemeral.rs | 2 +- src/events/chatlist_events.rs | 2 +- src/message.rs | 2 +- src/message/message_tests.rs | 10 +-- src/mimefactory.rs | 2 +- src/mimeparser.rs | 4 +- src/receive_imf.rs | 78 +++++++++---------- src/receive_imf/receive_imf_tests.rs | 62 +++++++-------- src/securejoin.rs | 6 +- src/securejoin/bob.rs | 14 ++-- src/securejoin/securejoin_tests.rs | 22 +++--- src/sql/migrations.rs | 8 +- src/stats.rs | 12 +-- src/stats/stats_tests.rs | 16 ++-- src/test_utils.rs | 28 +++---- src/tests/aeap.rs | 8 +- src/tests/verified_chats.rs | 16 ++-- .../receive_imf_older_message_from_2nd_device | 2 +- ...test_broadcast_joining_golden_private_chat | 2 +- test-data/golden/test_old_message_1 | 2 +- test-data/golden/test_old_message_2 | 2 +- test-data/golden/test_old_message_3 | 2 +- test-data/golden/test_outgoing_encrypted_msg | 2 +- test-data/golden/test_outgoing_mua_msg | 2 +- test-data/golden/test_outgoing_mua_msg_pgp | 2 +- ...test_verified_oneonone_chat_enable_disable | 2 +- 47 files changed, 274 insertions(+), 280 deletions(-) diff --git a/README.md b/README.md index ba61fe7a5..3389324bf 100644 --- a/README.md +++ b/README.md @@ -108,10 +108,10 @@ Create a chat with your friend and send a message: ``` > createchat 10 -Single#Chat#12 created successfully. +Direct#Chat#12 created successfully. > chat 12 Selecting chat Chat#12 -Single#Chat#12: yourfriends@email.org [yourfriends@email.org] Icon: profile-db-blobs/4138c52e5bc1c576cda7dd44d088c07.png +Direct#Chat#12: yourfriends@email.org [yourfriends@email.org] Icon: profile-db-blobs/4138c52e5bc1c576cda7dd44d088c07.png 0 messages. 81.252µs to create this list, 123.625µs to mark all messages as noticed. > send hi diff --git a/deltachat-ffi/deltachat.h b/deltachat-ffi/deltachat.h index 223ec31cb..5833f654e 100644 --- a/deltachat-ffi/deltachat.h +++ b/deltachat-ffi/deltachat.h @@ -905,7 +905,7 @@ dc_chatlist_t* dc_get_chatlist (dc_context_t* context, int flags, // handle chats /** - * Create a normal chat with a single user. To create group chats, + * Create a direct chat with a single user. To create group chats, * see dc_create_group_chat(). * * If a chat already exists, this ID is returned, otherwise a new chat is created; @@ -921,14 +921,14 @@ uint32_t dc_create_chat_by_contact_id (dc_context_t* context, uint32_t co /** - * Check, if there is a normal chat with a given contact. + * Check, if there is a direct chat with a given contact. * To get the chat messages, use dc_get_chat_msgs(). * * @memberof dc_context_t * @param context The context object as returned from dc_context_new(). * @param contact_id The contact ID to check. - * @return If there is a normal chat with the given contact_id, this chat_id is - * returned. If there is no normal chat with the contact_id, the function + * @return If there is a direct chat with the given contact_id, this chat_id is + * returned. If there is no direct chat with the contact_id, the function * returns 0. */ uint32_t dc_get_chat_id_by_contact_id (dc_context_t* context, uint32_t contact_id); @@ -1225,7 +1225,7 @@ uint32_t dc_init_webxdc_integration (dc_context_t* context, uint32_t c * @memberof dc_context_t * @param context The context object. * @param chat_id The chat to place a call for. - * This needs to be a one-to-one chat. + * This needs to be a direct chat. * @param place_call_info any data that other devices receive * in #DC_EVENT_INCOMING_CALL. * @param has_video Whether the call has video initially. @@ -1631,7 +1631,7 @@ void dc_set_chat_visibility (dc_context_t* context, uint32_t ch * - The chat or the contact is **not blocked**, so new messages from the user/the group may appear * and the user may create the chat again. * - **Groups are not left** - this would - * be unexpected as (1) deleting a normal chat also does not prevent new mails + * be unexpected as (1) deleting a direct chat also does not prevent new mails * from arriving, (2) leaving a group requires sending a message to * all group members - especially for groups not used for a longer time, this is * really unexpected when deletion results in contacting all members again, @@ -1649,7 +1649,7 @@ void dc_delete_chat (dc_context_t* context, uint32_t ch /** * Block a chat. * - * Blocking 1:1 chats blocks the corresponding contact. Blocking + * Blocking direct chats blocks the corresponding contact. Blocking * mailing lists creates a pseudo-contact in the list of blocked * contacts, so blocked mailing lists can be discovered and unblocked * the same way as the contacts. Blocking group chats deletes the @@ -1678,7 +1678,7 @@ void dc_accept_chat (dc_context_t* context, uint32_t ch /** * Get the contact IDs belonging to a chat. * - * - for normal chats, the function always returns exactly one contact, + * - for direct chats, the function always returns exactly one contact, * DC_CONTACT_ID_SELF is returned only for SELF-chats. * * - for group chats all members are returned, DC_CONTACT_ID_SELF is returned @@ -3700,7 +3700,7 @@ char* dc_chat_get_mailinglist_addr (const dc_chat_t* chat); /** - * Get name of a chat. For one-to-one chats, this is the name of the contact. + * Get name of a chat. For direct chats, this is the name of the contact. * For group chats, this is the name given e.g. to dc_create_group_chat() or * received by a group-creation message. * @@ -3717,7 +3717,7 @@ char* dc_chat_get_name (const dc_chat_t* chat); * Get the chat's profile image. * For groups, this is the image set by any group member * using dc_set_chat_profile_image(). - * For normal chats, this is the image set by each remote user on their own + * For direct chats, this is the image set by each remote user on their own * using dc_set_config(context, "selfavatar", image). * * @memberof dc_chat_t @@ -3731,7 +3731,7 @@ char* dc_chat_get_profile_image (const dc_chat_t* chat); /** * Get a color for the chat. - * For 1:1 chats, the color is calculated from the contact's e-mail address. + * For direct chats, the color is calculated from the contact's e-mail address. * Otherwise, the chat name is used. * The color can be used for an fallback avatar with white initials * as well as for headlines in bubbles of group chats. @@ -3798,7 +3798,7 @@ int dc_chat_is_unpromoted (const dc_chat_t* chat); /** - * Check if a chat is a self talk. Self talks are normal chats with + * Check if a chat is a self talk. Self talks are direct chats with * the only contact DC_CONTACT_ID_SELF. * * @memberof dc_chat_t @@ -3853,9 +3853,9 @@ int dc_chat_is_protected (const dc_chat_t* chat); /** * Check if the chat is encrypted. * - * 1:1 chats with key-contacts and group chats with key-contacts + * Direct chats with key-contacts and group chats with key-contacts * are encrypted. - * 1:1 chats with emails contacts and ad-hoc groups + * Direct chats with emails contacts and ad-hoc groups * created for email threads are not encrypted. * * @memberof dc_chat_t @@ -4389,7 +4389,7 @@ char* dc_msg_get_summarytext (const dc_msg_t* msg, int approx_c * display name, or NULL. * * If this returns non-NULL, put a `~` before the override-sender-name and show the - * override-sender-name and the sender's avatar even in 1:1 chats. + * override-sender-name and the sender's avatar even in direct chats. * * In mailing lists, sender display name and sender address do not always belong together. * In this case, this function gives you the name that should actually be shown over the message. @@ -5635,13 +5635,13 @@ int64_t dc_lot_get_timestamp (const dc_lot_t* lot); #define DC_CHAT_TYPE_UNDEFINED 0 /** - * A one-to-one chat with a single contact. + * A direct chat with a single contact. * * dc_get_chat_contacts() contains one record for the user. * DC_CONTACT_ID_SELF is added _only_ for a self talk. * These chats are created by dc_create_chat_by_contact_id(). */ -#define DC_CHAT_TYPE_SINGLE 100 +#define DC_CHAT_TYPE_DIRECT 100 /** * A group chat. @@ -6745,7 +6745,7 @@ void dc_event_unref(dc_event_t* event); /** * Chats with normal visibility are not archived and are shown below all pinned chats. - * Archived chats, that receive new messages automatically become normal chats. + * Archived chats, that receive new messages automatically change their visibility to normal. */ #define DC_CHAT_VISIBILITY_NORMAL 0 @@ -6757,7 +6757,7 @@ void dc_event_unref(dc_event_t* event); * The UI typically shows a little icon or chats beside archived chats in the chatlist, * this is needed as e.g. the search will also return archived chats. * - * If archived chats receive new messages, they become normal chats again. + * If such chat receives a new messages, their visibility changes to normal. * * To get a list of archived chats, use dc_get_chatlist() with the flag DC_GCL_ARCHIVED_ONLY. */ @@ -6955,7 +6955,7 @@ void dc_event_unref(dc_event_t* event); /// "Message from %1$s" /// -/// Used in subjects of outgoing messages in one-to-one chats. +/// Used in subjects of outgoing messages in direct chats. /// - %1$s will be replaced by the name of the sender, /// this is the dc_set_config()-option `displayname` or `addr` #define DC_STR_SUBJECT_FOR_NEW_CONTACT 73 diff --git a/deltachat-jsonrpc/src/api.rs b/deltachat-jsonrpc/src/api.rs index 788a220f7..54d246087 100644 --- a/deltachat-jsonrpc/src/api.rs +++ b/deltachat-jsonrpc/src/api.rs @@ -875,7 +875,7 @@ impl CommandApi { /// - The chat or the contact is **not blocked**, so new messages from the user/the group may appear as a contact request /// and the user may create the chat again. /// - **Groups are not left** - this would - /// be unexpected as (1) deleting a normal chat also does not prevent new mails + /// be unexpected as (1) deleting a direct chat also does not prevent new mails /// from arriving, (2) leaving a group requires sending a message to /// all group members - especially for groups not used for a longer time, this is /// really unexpected when deletion results in contacting all members again, @@ -1040,7 +1040,7 @@ impl CommandApi { /// Get the contact IDs belonging to a chat. /// - /// - for normal chats, the function always returns exactly one contact, + /// - for direct chats, the function always returns exactly one contact, /// DC_CONTACT_ID_SELF is returned only for SELF-chats. /// /// - for group chats all members are returned, DC_CONTACT_ID_SELF is returned diff --git a/deltachat-jsonrpc/src/api/types/chat.rs b/deltachat-jsonrpc/src/api/types/chat.rs index 42d69ffa6..0d4db3118 100644 --- a/deltachat-jsonrpc/src/api/types/chat.rs +++ b/deltachat-jsonrpc/src/api/types/chat.rs @@ -92,7 +92,7 @@ impl FullChat { let can_send = chat.can_send(context).await?; - let was_seen_recently = if chat.get_type() == Chattype::Single { + let was_seen_recently = if chat.get_type() == Chattype::Direct { match contact_ids.first() { Some(contact) => Contact::get_by_id(context, *contact) .await @@ -259,7 +259,7 @@ impl JsonrpcChatVisibility { #[derive(Clone, Serialize, Deserialize, PartialEq, TypeDef, schemars::JsonSchema)] #[serde(rename = "ChatType")] pub enum JsonrpcChatType { - Single, + Direct, Group, Mailinglist, OutBroadcast, @@ -269,7 +269,7 @@ pub enum JsonrpcChatType { impl From for JsonrpcChatType { fn from(chattype: Chattype) -> Self { match chattype { - Chattype::Single => JsonrpcChatType::Single, + Chattype::Direct => JsonrpcChattype::Direct, Chattype::Group => JsonrpcChatType::Group, Chattype::Mailinglist => JsonrpcChatType::Mailinglist, Chattype::OutBroadcast => JsonrpcChatType::OutBroadcast, @@ -281,7 +281,7 @@ impl From for JsonrpcChatType { impl From for Chattype { fn from(chattype: JsonrpcChatType) -> Self { match chattype { - JsonrpcChatType::Single => Chattype::Single, + JsonrpcChattype::Direct => Chattype::Direct, JsonrpcChatType::Group => Chattype::Group, JsonrpcChatType::Mailinglist => Chattype::Mailinglist, JsonrpcChatType::OutBroadcast => Chattype::OutBroadcast, diff --git a/deltachat-jsonrpc/src/api/types/chat_list.rs b/deltachat-jsonrpc/src/api/types/chat_list.rs index a07641b2b..f40aa60d2 100644 --- a/deltachat-jsonrpc/src/api/types/chat_list.rs +++ b/deltachat-jsonrpc/src/api/types/chat_list.rs @@ -127,7 +127,7 @@ pub(crate) async fn get_chat_list_item_by_id( None => (None, None), }; - let (dm_chat_contact, was_seen_recently) = if chat.get_type() == Chattype::Single { + let (dm_chat_contact, was_seen_recently) = if chat.get_type() == Chattype::Direct { let chat_contacts = get_chat_contacts(ctx, chat_id).await?; let contact = chat_contacts.first(); let was_seen_recently = match contact { diff --git a/deltachat-jsonrpc/src/api/types/message.rs b/deltachat-jsonrpc/src/api/types/message.rs index 2b37fb507..4fee15734 100644 --- a/deltachat-jsonrpc/src/api/types/message.rs +++ b/deltachat-jsonrpc/src/api/types/message.rs @@ -390,11 +390,11 @@ pub enum SystemMessageType { LocationOnly, InvalidUnencryptedMail, - /// 1:1 chats info message telling that SecureJoin has started and the user should wait for it + /// Direct chats info message telling that SecureJoin has started and the user should wait for it /// to complete. SecurejoinWait, - /// 1:1 chats info message telling that SecureJoin is still running, but the user may already + /// Direct chats info message telling that SecureJoin is still running, but the user may already /// send messages. SecurejoinWaitTimeout, diff --git a/deltachat-jsonrpc/typescript/scripts/generate-constants.js b/deltachat-jsonrpc/typescript/scripts/generate-constants.js index e8b09d2e1..dc006e212 100755 --- a/deltachat-jsonrpc/typescript/scripts/generate-constants.js +++ b/deltachat-jsonrpc/typescript/scripts/generate-constants.js @@ -68,7 +68,7 @@ ${constants} export const DC_CHAT_TYPE_MAILINGLIST = "Mailinglist"; /** @deprecated 10-8-2025 compare string directly with \`== "OutBroadcast"\` */ export const DC_CHAT_TYPE_OUT_BROADCAST = "OutBroadcast"; - /** @deprecated 10-8-2025 compare string directly with \`== "Single"\` */ - export const DC_CHAT_TYPE_SINGLE = "Single"; + /** @deprecated 10-8-2025 compare string directly with \`== "Direct"\` */ + export const DC_CHAT_TYPE_DIRECT = "Direct"; }\n`, ); diff --git a/deltachat-repl/src/cmdline.rs b/deltachat-repl/src/cmdline.rs index be29cfc13..42655179d 100644 --- a/deltachat-repl/src/cmdline.rs +++ b/deltachat-repl/src/cmdline.rs @@ -639,7 +639,7 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu let members = chat::get_chat_contacts(&context, sel_chat.id).await?; let subtitle = if sel_chat.is_device_talk() { "device-talk".to_string() - } else if sel_chat.get_type() == Chattype::Single && !members.is_empty() { + } else if sel_chat.get_type() == Chattype::Direct && !members.is_empty() { let contact = Contact::get_by_id(&context, members[0]).await?; contact.get_addr().to_string() } else if sel_chat.get_type() == Chattype::Mailinglist && !members.is_empty() { @@ -690,7 +690,7 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu let contact_id = ContactId::new(arg1.parse()?); let chat_id = ChatId::create_for_contact(&context, contact_id).await?; - println!("Single#{chat_id} created successfully.",); + println!("Direct#{chat_id} created successfully.",); } "creategroup" => { ensure!(!arg1.is_empty(), "Argument missing."); diff --git a/deltachat-rpc-client/src/deltachat_rpc_client/contact.py b/deltachat-rpc-client/src/deltachat_rpc_client/contact.py index 1c0389064..7b306c492 100644 --- a/deltachat-rpc-client/src/deltachat_rpc_client/contact.py +++ b/deltachat-rpc-client/src/deltachat_rpc_client/contact.py @@ -55,7 +55,7 @@ class Contact: return snapshot def create_chat(self) -> "Chat": - """Create or get an existing 1:1 chat for this contact.""" + """Create or get an existing direct chat for this contact.""" from .chat import Chat return Chat( diff --git a/python/src/deltachat/account.py b/python/src/deltachat/account.py index 8ab9edbaf..eedb81f4f 100644 --- a/python/src/deltachat/account.py +++ b/python/src/deltachat/account.py @@ -397,7 +397,7 @@ class Account: return (x for x in iter_array(dc_array, lambda x: Message.from_db(self, x)) if x is not None) def create_chat(self, obj) -> Chat: - """Create a 1:1 chat with Account, Contact or e-mail address.""" + """Create a direct chat with Account, Contact or e-mail address.""" return self.create_contact(obj).create_chat() def create_group_chat( diff --git a/python/src/deltachat/chat.py b/python/src/deltachat/chat.py index e9d15ac67..241c44a61 100644 --- a/python/src/deltachat/chat.py +++ b/python/src/deltachat/chat.py @@ -73,9 +73,9 @@ class Chat: """ return lib.dc_chat_get_type(self._dc_chat) == const.DC_CHAT_TYPE_GROUP - def is_single(self) -> bool: - """Return True if this chat is a single/direct chat, False otherwise.""" - return lib.dc_chat_get_type(self._dc_chat) == const.DC_CHAT_TYPE_SINGLE + def is_direct(self) -> bool: + """Return True if this chat is a direct chat, False otherwise.""" + return lib.dc_chat_get_type(self._dc_chat) == const.DC_CHAT_TYPE_DIRECT def is_mailinglist(self) -> bool: """Return True if this chat is a mailing list, False otherwise.""" @@ -458,7 +458,7 @@ class Chat: """Get group profile image. For groups, this is the image set by any group member using - set_chat_profile_image(). For normal chats, this is the image + set_chat_profile_image(). For direct chats, this is the image set by each remote user on their own using dc_set_config(context, "selfavatar", image). :returns: path to profile image, None if no profile image exists. diff --git a/python/src/deltachat/contact.py b/python/src/deltachat/contact.py index fc5713d61..983dddd11 100644 --- a/python/src/deltachat/contact.py +++ b/python/src/deltachat/contact.py @@ -107,7 +107,7 @@ class Contact: return from_dc_charpointer(lib.dc_contact_get_status(self._dc_contact)) def create_chat(self): - """create or get an existing 1:1 chat object for the specified contact or contact id. + """create or get an existing direct chat object for the specified contact or contact id. :param contact: chat_id (int) or contact object. :returns: a :class:`deltachat.chat.Chat` object. diff --git a/python/src/deltachat/message.py b/python/src/deltachat/message.py index 409408f48..da4446777 100644 --- a/python/src/deltachat/message.py +++ b/python/src/deltachat/message.py @@ -283,7 +283,7 @@ class Message: lib.dc_msg_set_override_sender_name(self._dc_msg, as_dc_charpointer(name)) def get_sender_chat(self): - """return the 1:1 chat with the sender of this message. + """return the direct chat with the sender of this message. :returns: :class:`deltachat.chat.Chat` instance """ diff --git a/src/calls.rs b/src/calls.rs index a934ddc76..9ca670197 100644 --- a/src/calls.rs +++ b/src/calls.rs @@ -200,8 +200,8 @@ impl Context { ) -> Result { let chat = Chat::load_from_db(self, chat_id).await?; ensure!( - chat.typ == Chattype::Single, - "Can only place calls in 1:1 chats" + chat.typ == Chattype::Direct, + "Can only place calls in direct chats" ); ensure!(!chat.is_self_talk(), "Cannot call self"); diff --git a/src/chat.rs b/src/chat.rs index ab4b62cd5..fbe356194 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -97,7 +97,7 @@ pub(crate) enum CantSendReason { /// Not a member of the chat. NotAMember, - /// State for 1:1 chat with a key-contact that does not have a key. + /// State for direct chat with a key-contact that does not have a key. MissingKey, } @@ -194,7 +194,7 @@ impl ChatId { Some(msg.chat_id) } - /// Returns the [`ChatId`] for the 1:1 chat with `contact_id` + /// Returns the [`ChatId`] for the direct chat with `contact_id` /// if it exists and is not blocked. /// /// If the chat does not exist or is blocked, `None` is returned. @@ -214,7 +214,7 @@ impl ChatId { Ok(chat_id) } - /// Returns the [`ChatId`] for the 1:1 chat with `contact_id`. + /// Returns the [`ChatId`] for the direct chat with `contact_id`. /// /// If the chat does not yet exist an unblocked chat ([`Blocked::Not`]) is created. /// @@ -227,9 +227,9 @@ impl ChatId { .map(|chat| chat.id) } - /// Returns the unblocked 1:1 chat with `contact_id`. + /// Returns the unblocked direct chat with `contact_id`. /// - /// This should be used when **a user action** creates a chat 1:1, it ensures the chat + /// This should be used when **a user action** creates a chat direct, it ensures the chat /// exists, is unblocked and scales the [`Contact`]'s origin. pub async fn create_for_contact(context: &Context, contact_id: ContactId) -> Result { ChatId::create_for_contact_with_blocked(context, contact_id, Blocked::Not).await @@ -369,12 +369,12 @@ impl ChatId { Chattype::OutBroadcast => { bail!("Can't block chat of type {:?}", chat.typ) } - Chattype::Single => { + Chattype::Direct => { for contact_id in get_chat_contacts(context, self).await? { if contact_id != ContactId::SELF { info!( context, - "Blocking the contact {contact_id} to block 1:1 chat." + "Blocking the contact {contact_id} to block a direct chat." ); contact::set_blocked(context, Nosync, contact_id, true).await?; } @@ -393,7 +393,7 @@ impl ChatId { chatlist_events::emit_chatlist_changed(context); if sync.into() { - // NB: For a 1:1 chat this currently triggers `Contact::block()` on other devices. + // NB: For a direct chat this currently triggers `Contact::block()` on other devices. chat.sync(context, SyncAction::Block) .await .log_err(context) @@ -417,7 +417,7 @@ impl ChatId { if sync.into() { let chat = Chat::load_from_db(context, self).await?; - // TODO: For a 1:1 chat this currently triggers `Contact::unblock()` on other devices. + // TODO: For a direct chat this currently triggers `Contact::unblock()` on other devices. // Maybe we should unblock the contact locally too, this would also resolve discrepancy // with `block()` which also blocks the contact. chat.sync(context, SyncAction::Unblock) @@ -440,7 +440,7 @@ impl ChatId { let chat = Chat::load_from_db(context, self).await?; match chat.typ { - Chattype::Single | Chattype::Group | Chattype::OutBroadcast | Chattype::InBroadcast => { + Chattype::Direct | Chattype::Group | Chattype::OutBroadcast | Chattype::InBroadcast => { // Previously accepting a chat literally created a chat because unaccepted chats // went to "contact requests" list rather than normal chatlist. // But for groups we use lower origin because users don't always check all members @@ -1154,7 +1154,7 @@ SELECT id, rfc724_mid, pre_rfc724_mid, timestamp, ?, 1 FROM msgs WHERE chat_id=? MessageState::InSeen as u32, state_out_min as u32, // Do not reply to not fully downloaded messages. Such a message could be a group chat - // message that we assigned to 1:1 chat. + // message that we assigned to a direct chat. DownloadState::Done as u32, // Do not reference info messages, they are not actually sent out // and have Message-IDs unknown to other chat members. @@ -1347,7 +1347,7 @@ pub struct Chat { /// Database ID. pub id: ChatId, - /// Chat type, e.g. 1:1 chat, group chat, mailing list. + /// Chat type, e.g. a direct chat, group chat, mailing list. pub typ: Chattype, /// Chat name. @@ -1356,7 +1356,7 @@ pub struct Chat { /// Whether the chat is archived or pinned. pub visibility: ChatVisibility, - /// Group ID. For [`Chattype::Mailinglist`] -- mailing list address. Empty for 1:1 chats and + /// Group ID. For [`Chattype::Mailinglist`] -- mailing list address. Empty for direct chats and /// ad-hoc groups. pub grpid: String, @@ -1405,7 +1405,7 @@ impl Chat { if chat.id.is_archived_link() { chat.name = stock_str::archived_chats(context); } else { - if chat.typ == Chattype::Single && chat.name.is_empty() { + if chat.typ == Chattype::Direct && chat.name.is_empty() { // chat.name is set to contact.display_name on changes, // however, if things went wrong somehow, we do this here explicitly. let mut chat_name = "Err [Name not found]".to_owned(); @@ -1504,7 +1504,7 @@ impl Chat { } let reason = MissingKey; - if !skip_fn(&reason) && self.typ == Chattype::Single { + if !skip_fn(&reason) && self.typ == Chattype::Direct { let contact_ids = get_chat_contacts(context, self.id).await?; if let Some(contact_id) = contact_ids.first() { let contact = Contact::get_by_id(context, *contact_id).await?; @@ -1529,7 +1529,7 @@ impl Chat { /// The function does not check if the chat type allows editing of concrete elements. pub async fn is_self_in_chat(&self, context: &Context) -> Result { match self.typ { - Chattype::Single | Chattype::OutBroadcast | Chattype::Mailinglist => Ok(true), + Chattype::Direct | Chattype::OutBroadcast | Chattype::Mailinglist => Ok(true), Chattype::Group | Chattype::InBroadcast => { is_contact_in_chat(context, self.id, ContactId::SELF).await } @@ -1583,8 +1583,8 @@ impl Chat { context, Path::new(&get_unencrypted_icon(context).await?), ))); - } else if self.typ == Chattype::Single { - // For 1:1 chats, we always use the same avatar as for the contact + } else if self.typ == Chattype::Direct { + // For direct chats, we always use the same avatar as for the contact // This is before the `self.is_encrypted()` check, because that function // has two database calls, i.e. it's slow let contacts = get_chat_contacts(context, self.id).await?; @@ -1603,13 +1603,13 @@ impl Chat { /// Returns chat avatar color. /// - /// For 1:1 chats, the color is calculated from the contact's address + /// For direct chats, the color is calculated from the contact's address /// for address-contacts and from the OpenPGP key fingerprint for key-contacts. /// For group chats the color is calculated from the grpid, if present, or the chat name. pub async fn get_color(&self, context: &Context) -> Result { let mut color = 0; - if self.typ == Chattype::Single { + if self.typ == Chattype::Direct { let contacts = get_chat_contacts(context, self.id).await?; if let Some(contact_id) = contacts.first() && let Ok(contact) = Contact::get_by_id(context, *contact_id).await @@ -1680,7 +1680,7 @@ impl Chat { pub async fn is_encrypted(&self, context: &Context) -> Result { let is_encrypted = self.is_self_talk() || match self.typ { - Chattype::Single => { + Chattype::Direct => { match context .sql .query_row_optional( @@ -1766,7 +1766,7 @@ impl Chat { msg.rfc724_mid = create_outgoing_rfc724_mid(); } - if self.typ == Chattype::Single { + if self.typ == Chattype::Direct { if let Some(id) = context .sql .query_get_value( @@ -2070,7 +2070,7 @@ impl Chat { /// Returns chat id for the purpose of synchronisation across devices. async fn get_sync_id(&self, context: &Context) -> Result> { match self.typ { - Chattype::Single => { + Chattype::Direct => { if self.is_device_talk() { return Ok(Some(SyncId::Device)); } @@ -2184,7 +2184,7 @@ pub struct ChatInfo { /// The type of chat as a `u32` representation of [Chattype]. /// /// On the C API this number is one of the - /// `DC_CHAT_TYPE_UNDEFINED`, `DC_CHAT_TYPE_SINGLE`, + /// `DC_CHAT_TYPE_UNDEFINED`, `DC_CHAT_TYPE_DIRECT`, /// or `DC_CHAT_TYPE_GROUP` /// constants. #[serde(rename = "type")] @@ -2338,7 +2338,7 @@ pub(crate) struct ChatIdBlocked { } impl ChatIdBlocked { - /// Searches the database for the 1:1 chat with this contact. + /// Searches the database for the direct chat with this contact. /// /// If no chat is found `None` is returned. pub async fn lookup_by_contact( @@ -2358,7 +2358,7 @@ impl ChatIdBlocked { FROM chats c INNER JOIN chats_contacts j ON c.id=j.chat_id - WHERE c.type=100 -- 100 = Chattype::Single + WHERE c.type=100 -- 100 = Chattype::Direct AND c.id>9 -- 9 = DC_CHAT_ID_LAST_SPECIAL AND j.contact_id=?;", (contact_id,), @@ -2371,7 +2371,7 @@ impl ChatIdBlocked { .await } - /// Returns the chat for the 1:1 chat with this contact. + /// Returns the chat for the direct chat with this contact. /// /// If the chat does not yet exist a new one is created, using the provided [`Blocked`] /// state. @@ -2414,7 +2414,7 @@ impl ChatIdBlocked { (type, name, name_normalized, param, blocked, created_timestamp) VALUES(?, ?, ?, ?, ?, ?)", ( - Chattype::Single, + Chattype::Direct, &chat_name, normalize_text(&chat_name), params.to_string(), @@ -2579,11 +2579,11 @@ pub async fn is_contact_in_chat( chat_id: ChatId, contact_id: ContactId, ) -> Result { - // this function works for group and for normal chats, however, it is more useful + // this function works for group and for direct chats, however, it is more useful // for group chats. // ContactId::SELF may be used to check whether oneself // is in a group or incoming broadcast chat - // (ContactId::SELF is not added to 1:1 chats or outgoing broadcast channels) + // (ContactId::SELF is not added to direct chats or outgoing broadcast channels) let exists = context .sql @@ -2692,9 +2692,9 @@ async fn prepare_send_msg( // Check a quote reply is not leaking data from other chats. // This is meant as a last line of defence, the UI should check that before as well. - // (We allow Chattype::Single in general for "Reply Privately"; + // (We allow Chattype::Direct in general for "Reply Privately"; // checking for exact contact_id will produce false positives when ppl just left the group) - if chat.typ != Chattype::Single + if chat.typ != Chattype::Direct && !context.get_config_bool(Config::Bot).await? && let Some(quoted_message) = msg.quoted_message(context).await? && quoted_message.chat_id != chat_id @@ -3493,7 +3493,7 @@ pub async fn get_chat_media( /// Returns a vector of contact IDs for given chat ID. pub async fn get_chat_contacts(context: &Context, chat_id: ChatId) -> Result> { - // Normal chats do not include SELF. Group chats do (as it may happen that one is deleted from a + // Direct chats do not include SELF. Group chats do (as it may happen that one is deleted from a // groupchat but the chats stays visible, moreover, this makes displaying lists easier) context .sql @@ -3877,7 +3877,7 @@ pub(crate) async fn add_contact_to_chat_ex( chat_id.reset_gossiped_timestamp(context).await?; - // this also makes sure, no contacts are added to special or normal chats + // this also makes sure, no contacts are added to special or direct chats let mut chat = Chat::load_from_db(context, chat_id).await?; ensure!( chat.typ == Chattype::Group || (from_handshake && chat.typ == Chattype::OutBroadcast), @@ -4350,7 +4350,7 @@ async fn rename_ex( new_name: &str, ) -> Result<()> { let new_name = sanitize_single_line(new_name); - /* the function only sets the names of group chats; normal chats get their names from the contacts */ + /* the function only sets the names of group chats; direct chats get their names from the contacts */ let mut success = false; ensure!(!new_name.is_empty(), "Invalid name"); diff --git a/src/chat/chat_tests.rs b/src/chat/chat_tests.rs index a27b70670..d8c948c04 100644 --- a/src/chat/chat_tests.rs +++ b/src/chat/chat_tests.rs @@ -259,9 +259,9 @@ async fn test_quote_replies() -> Result<()> { let grp_msg_id = send_text_msg(&alice, grp_chat_id, "bar".to_string()).await?; let grp_msg = Message::load_from_db(&alice, grp_msg_id).await?; - let one2one_chat_id = alice.create_chat(&bob).await.id; - let one2one_msg_id = send_text_msg(&alice, one2one_chat_id, "foo".to_string()).await?; - let one2one_msg = Message::load_from_db(&alice, one2one_msg_id).await?; + let direct_chat_id = alice.create_chat(&bob).await.id; + let direct_msg_id = send_text_msg(&alice, direct_chat_id, "foo".to_string()).await?; + let direct_msg = Message::load_from_db(&alice, direct_msg_id).await?; // quoting messages in same chat is okay let mut msg = Message::new_text("baz".to_string()); @@ -270,25 +270,25 @@ async fn test_quote_replies() -> Result<()> { assert!(result.is_ok()); let mut msg = Message::new_text("baz".to_string()); - msg.set_quote(&alice, Some(&one2one_msg)).await?; - let result = send_msg(&alice, one2one_chat_id, &mut msg).await; + msg.set_quote(&alice, Some(&direct_msg)).await?; + let result = send_msg(&alice, direct_chat_id, &mut msg).await; assert!(result.is_ok()); - let one2one_quote_reply_msg_id = result.unwrap(); + let direct_quote_reply_msg_id = result.unwrap(); - // quoting messages from groups to one-to-ones is okay ("reply privately") + // quoting messages from groups to direct chats is okay ("reply privately") let mut msg = Message::new_text("baz".to_string()); msg.set_quote(&alice, Some(&grp_msg)).await?; - let result = send_msg(&alice, one2one_chat_id, &mut msg).await; + let result = send_msg(&alice, direct_chat_id, &mut msg).await; assert!(result.is_ok()); - // quoting messages from one-to-one chats in groups is an error; usually this is also not allowed by UI at all ... + // quoting messages from direct chats in groups is an error; usually this is also not allowed by UI at all ... let mut msg = Message::new_text("baz".to_string()); - msg.set_quote(&alice, Some(&one2one_msg)).await?; + msg.set_quote(&alice, Some(&direct_msg)).await?; let result = send_msg(&alice, grp_chat_id, &mut msg).await; assert!(result.is_err()); // ... but forwarding messages with quotes is allowed - let result = forward_msgs(&alice, &[one2one_quote_reply_msg_id], grp_chat_id).await; + let result = forward_msgs(&alice, &[direct_quote_reply_msg_id], grp_chat_id).await; assert!(result.is_ok()); // ... and bots are not restricted @@ -775,17 +775,17 @@ async fn test_leave_group() -> Result<()> { Ok(()) } -/// Test that adding or removing contacts in 1:1 chat is not allowed. +/// Test that adding or removing contacts in direct chat is not allowed. #[tokio::test(flavor = "multi_thread", worker_threads = 2)] -async fn test_add_remove_contact_for_single() { +async fn test_add_remove_contact_for_direct() { let ctx = TestContext::new_alice().await; let bob = Contact::create(&ctx, "", "bob@f.br").await.unwrap(); let chat_id = ChatId::create_for_contact(&ctx, bob).await.unwrap(); let chat = Chat::load_from_db(&ctx, chat_id).await.unwrap(); - assert_eq!(chat.typ, Chattype::Single); + assert_eq!(chat.typ, Chattype::Direct); assert_eq!(get_chat_contacts(&ctx, chat.id).await.unwrap().len(), 1); - // adding or removing contacts from one-to-one-chats result in an error + // adding or removing contacts from direct-chats result in an error let claire = Contact::create(&ctx, "", "claire@foo.de").await.unwrap(); let added = add_contact_to_chat_ex(&ctx, Nosync, chat.id, claire, false).await; assert!(added.is_err()); @@ -909,7 +909,7 @@ async fn test_add_device_msg_labelled() -> Result<()> { assert_eq!(chat_id.get_msg_cnt(&t).await?, 1); assert!(!chat_id.is_special()); let chat = Chat::load_from_db(&t, chat_id).await?; - assert_eq!(chat.get_type(), Chattype::Single); + assert_eq!(chat.get_type(), Chattype::Direct); assert!(chat.is_device_talk()); assert!(!chat.is_self_talk()); assert!(!chat.can_send(&t).await?); @@ -3624,7 +3624,7 @@ async fn test_broadcast_joining_golden() -> Result<()> { .await; let alice_bob_contact = alice.add_or_lookup_contact_no_key(bob).await; - // The 1:1 chat with Bob should not be visible to the user: + // The direct chat with Bob should not be visible to the user: assert!( ChatIdBlocked::lookup_by_contact(alice, alice_bob_contact.id) .await? @@ -3937,7 +3937,7 @@ async fn test_leave_broadcast_multidevice() -> Result<()> { bob1.recv_msg_trash(&request_with_auth).await; bob1.recv_msg(&member_added).await; - // The 1:1 chat should not be visible to the user on any of the devices. + // The direct chat should not be visible to the user on any of the devices. // The contact should be marked as verified. check_direct_chat_is_hidden_and_contact_is_verified(alice, bob0).await; check_direct_chat_is_hidden_and_contact_is_verified(bob0, alice).await; @@ -4020,7 +4020,7 @@ async fn test_only_broadcast_owner_can_send_1() -> Result<()> { .await?; tcm.section( - "Bob receives an answer, but shows it in 1:1 chat because of a fingerprint mismatch", + "Bob receives an answer, but shows it in a direct chat because of a fingerprint mismatch", ); let rcvd = bob.recv_msg(&member_added).await; assert_eq!(rcvd.text, "Member bob@example.net was added."); @@ -4607,7 +4607,7 @@ async fn test_sync_blocked() -> Result<()> { sync(alice0, alice1).await; assert_eq!(alice1.get_chat(bob).await.blocked, Blocked::Not); - // Unblocking a 1:1 chat doesn't unblock the contact currently. + // Unblocking a direct chat doesn't unblock the contact currently. Contact::unblock(alice0, a0b_contact_id).await?; assert!(!alice1.add_or_lookup_contact(bob).await.is_blocked()); @@ -5153,7 +5153,7 @@ async fn test_blocked_bob_cant_join_chat() -> Result<()> { } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] -async fn test_blocked_bob_cant_create_11_chat_via_securejoin() -> Result<()> { +async fn test_blocked_bob_cant_create_direct_chat_via_securejoin() -> Result<()> { let mut tcm = TestContextManager::new(); let alice1 = &tcm.alice().await; let alice2 = &tcm.alice().await; @@ -6225,9 +6225,9 @@ async fn test_forward_msgs_2ctx_missing_blob() -> Result<()> { /// Tests that in multi-device setup /// second device learns the key of a contact -/// via Autocrypt-Gossip in 1:1 chats. +/// via Autocrypt-Gossip in direct chats. #[tokio::test(flavor = "multi_thread", worker_threads = 2)] -async fn test_oneone_gossip() -> Result<()> { +async fn test_direct_gossip() -> Result<()> { let mut tcm = TestContextManager::new(); let alice = &tcm.alice().await; let alice2 = &tcm.alice().await; diff --git a/src/chatlist.rs b/src/chatlist.rs index 17f20fcc3..fc67f8962 100644 --- a/src/chatlist.rs +++ b/src/chatlist.rs @@ -649,11 +649,11 @@ mod tests { } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] - async fn test_search_single_chat() -> anyhow::Result<()> { + async fn test_search_direct_chat() -> anyhow::Result<()> { let t = TestContext::new_alice().await; t.allow_unencrypted().await?; - // receive a one-to-one-message + // receive a direct message receive_imf( &t, b"From: Bob Authname \n\ @@ -681,12 +681,12 @@ mod tests { let chat = Chat::load_from_db(&t, chat_id).await?; assert_eq!(chat.get_name(), "Bob Authname"); - // check, the one-to-one-chat can be found using chatlist search query + // check, the direct chat can be found using chatlist search query let chats = Chatlist::try_load(&t, 0, Some("bob authname"), None).await?; assert_eq!(chats.len(), 1); assert_eq!(chats.get_chat_id(0).unwrap(), chat_id); - // change the name of the contact; this also changes the name of the one-to-one-chat + // change the name of the contact; this also changes the name of the direct chat let test_id = Contact::create(&t, "Bob Nickname", "bob@example.org").await?; assert_eq!(contact_id, test_id); let chat = Chat::load_from_db(&t, chat_id).await?; @@ -696,7 +696,7 @@ mod tests { let chats = Chatlist::try_load(&t, 0, Some("bob nickname"), None).await?; assert_eq!(chats.len(), 1); - // revert contact to authname, this again changes the name of the one-to-one-chat + // revert contact to authname, this again changes the name of the direct chat let test_id = Contact::create(&t, "", "bob@example.org").await?; assert_eq!(contact_id, test_id); let chat = Chat::load_from_db(&t, chat_id).await?; @@ -710,11 +710,11 @@ mod tests { } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] - async fn test_search_single_chat_without_authname() -> anyhow::Result<()> { + async fn test_search_direct_chat_without_authname() -> anyhow::Result<()> { let t = TestContext::new_alice().await; t.allow_unencrypted().await?; - // receive a one-to-one-message without authname set + // receive a direct message without authname set receive_imf( &t, b"From: bob@example.org\n\ @@ -737,12 +737,12 @@ mod tests { let chat = Chat::load_from_db(&t, chat_id).await?; assert_eq!(chat.get_name(), "bob@example.org"); - // check, the one-to-one-chat can be found using chatlist search query + // check, the direct chat can be found using chatlist search query let chats = Chatlist::try_load(&t, 0, Some("bob@example.org"), None).await?; assert_eq!(chats.len(), 1); assert_eq!(chats.get_chat_id(0)?, chat_id); - // change the name of the contact; this also changes the name of the one-to-one-chat + // change the name of the contact; this also changes the name of the direct chat let test_id = Contact::create(&t, "Bob Nickname", "bob@example.org").await?; assert_eq!(contact_id, test_id); let chat = Chat::load_from_db(&t, chat_id).await?; @@ -753,7 +753,7 @@ mod tests { assert_eq!(chats.len(), 1); assert_eq!(chats.get_chat_id(0)?, chat_id); - // revert name change, this again changes the name of the one-to-one-chat to the email-address + // revert name change, this again changes the name of the direct chat to the email-address let test_id = Contact::create(&t, "", "bob@example.org").await?; assert_eq!(contact_id, test_id); let chat = Chat::load_from_db(&t, chat_id).await?; diff --git a/src/constants.rs b/src/constants.rs index 9b109c0f5..39a6a4611 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -99,10 +99,10 @@ pub const DC_CHAT_ID_LAST_SPECIAL: ChatId = ChatId::new(9); )] #[repr(u32)] pub enum Chattype { - /// A 1:1 chat, i.e. a normal chat with a single contact. + /// A direct chat with a single contact. /// /// Created by [`ChatId::create_for_contact`]. - Single = 100, + Direct = 100, /// Group chat. /// @@ -245,7 +245,7 @@ mod tests { #[test] fn test_chattype_values() { // values may be written to disk and must not change - assert_eq!(Chattype::Single, Chattype::from_i32(100).unwrap()); + assert_eq!(Chattype::Direct, Chattype::from_i32(100).unwrap()); assert_eq!(Chattype::Group, Chattype::from_i32(120).unwrap()); assert_eq!(Chattype::Mailinglist, Chattype::from_i32(140).unwrap()); assert_eq!(Chattype::OutBroadcast, Chattype::from_i32(160).unwrap()); diff --git a/src/contact.rs b/src/contact.rs index 310600c96..d66cfbc86 100644 --- a/src/contact.rs +++ b/src/contact.rs @@ -891,7 +891,7 @@ impl Contact { min_origin as u32, blocked.is_none(), blocked.unwrap_or(Blocked::Not), - Chattype::Single, + Chattype::Direct, constants::DC_CHAT_ID_LAST_SPECIAL, blocked.unwrap_or(Blocked::Not), ), @@ -1789,7 +1789,7 @@ fn update_chat_names( ) -> Result<()> { let chat_id: Option = transaction.query_row( "SELECT id FROM chats WHERE type=? AND id IN(SELECT chat_id FROM chats_contacts WHERE contact_id=?)", - (Chattype::Single, contact_id), + (Chattype::Direct, contact_id), |row| { let chat_id: ChatId = row.get(0)?; Ok(chat_id) @@ -1856,7 +1856,7 @@ pub(crate) async fn set_blocked( // also (un)block all chats with _only_ this contact - we do not delete them to allow a // non-destructive blocking->unblocking. - // (Maybe, beside normal chats (type=100) we should also block group chats with only this user. + // (Maybe, beside direct chats (type=100) we should also block group chats with only this user. // However, I'm not sure about this point; it may be confusing if the user wants to add other people; // this would result in recreating the same group...) if context @@ -1869,7 +1869,7 @@ WHERE type=? AND id IN ( SELECT chat_id FROM chats_contacts WHERE contact_id=? ); "#, - (new_blocking, Chattype::Single, contact_id), + (new_blocking, Chattype::Direct, contact_id), ) .await .is_ok() diff --git a/src/contact/contact_tests.rs b/src/contact/contact_tests.rs index fbdf8133c..e3b48ad49 100644 --- a/src/contact/contact_tests.rs +++ b/src/contact/contact_tests.rs @@ -337,7 +337,7 @@ async fn test_contact_name_changes() -> Result<()> { let t = TestContext::new_alice().await; t.allow_unencrypted().await?; - // first message creates contact and one-to-one-chat without name set + // first message creates contact and direct-chat without name set receive_imf( &t, b"From: f@example.org\n\ diff --git a/src/context/context_tests.rs b/src/context/context_tests.rs index dc8d031f1..c97150223 100644 --- a/src/context/context_tests.rs +++ b/src/context/context_tests.rs @@ -396,7 +396,7 @@ async fn test_search_unaccepted_requests() -> Result<()> { let msg = tcm.send_recv(bob, t, "hello bob, foobar test!").await; let chat_id = msg.get_chat_id(); let chat = Chat::load_from_db(t, chat_id).await?; - assert_eq!(chat.get_type(), Chattype::Single); + assert_eq!(chat.get_type(), Chattype::Direct); assert!(chat.is_contact_request()); assert_eq!(Chatlist::try_load(t, 0, None, None).await?.len(), 1); diff --git a/src/ephemeral.rs b/src/ephemeral.rs index d9ea5b16b..31b8cd129 100644 --- a/src/ephemeral.rs +++ b/src/ephemeral.rs @@ -7,7 +7,7 @@ //! seen, which usually happens when its contents is displayed on //! device screen. //! -//! Each chat, including 1:1, group chats and "saved messages" chat, +//! Each chat, including direct, group chats and "saved messages" chat, //! has its own ephemeral timer setting, which is applied to all //! messages sent to the chat. The setting is synchronized to all the //! devices participating in the chat by applying the timer value from diff --git a/src/events/chatlist_events.rs b/src/events/chatlist_events.rs index ec909a12f..fa56dff6e 100644 --- a/src/events/chatlist_events.rs +++ b/src/events/chatlist_events.rs @@ -21,7 +21,7 @@ fn emit_unknown_chatlist_items_changed(context: &Context) { context.emit_event(EventType::ChatlistItemChanged { chat_id: None }); } -/// update event for the 1:1 chat with the contact +/// update event for the direct chat with the contact /// used when recently seen changes and when profile image changes pub(crate) async fn emit_chatlist_item_changed_for_contact_chat( context: &Context, diff --git a/src/message.rs b/src/message.rs index 4a80b5744..591dee90f 100644 --- a/src/message.rs +++ b/src/message.rs @@ -962,7 +962,7 @@ impl Message { Chattype::Group | Chattype::Mailinglist => { Some(Contact::get_by_id(context, self.from_id).await?) } - Chattype::Single | Chattype::OutBroadcast | Chattype::InBroadcast => None, + Chattype::Direct | Chattype::OutBroadcast | Chattype::InBroadcast => None, } } else { None diff --git a/src/message/message_tests.rs b/src/message/message_tests.rs index 407e247e4..813ea821b 100644 --- a/src/message/message_tests.rs +++ b/src/message/message_tests.rs @@ -212,8 +212,8 @@ async fn test_get_original_msg_id() -> Result<()> { let bob = TestContext::new_bob().await; // normal sending of messages does not have an original ID - let one2one_chat = alice.create_chat(&bob).await; - let sent = alice.send_text(one2one_chat.id, "foo").await; + let direct_chat = alice.create_chat(&bob).await; + let sent = alice.send_text(direct_chat.id, "foo").await; let orig_msg = Message::load_from_db(&alice, sent.sender_msg_id).await?; assert!(orig_msg.get_original_msg_id(&alice).await?.is_none()); assert!(orig_msg.parent(&alice).await?.is_none()); @@ -232,8 +232,8 @@ async fn test_get_original_msg_id() -> Result<()> { assert!(saved_msg.quoted_message(&alice).await?.is_none()); // forwarding from "Saved Messages" back to another chat, detaches original ID - forward_msgs(&alice, &[saved_msg.get_id()], one2one_chat.get_id()).await?; - let forwarded_msg = alice.get_last_msg_in(one2one_chat.get_id()).await; + forward_msgs(&alice, &[saved_msg.get_id()], direct_chat.get_id()).await?; + let forwarded_msg = alice.get_last_msg_in(direct_chat.get_id()).await; assert_ne!(forwarded_msg.get_id(), saved_msg.get_id()); assert_ne!(forwarded_msg.get_id(), orig_msg.get_id()); assert!(forwarded_msg.get_original_msg_id(&alice).await?.is_none()); @@ -275,7 +275,7 @@ async fn test_markseen_msgs() -> Result<()> { bob_chat_id.accept(&bob).await.unwrap(); // bob sends to alice, - // alice knows bob and messages appear in normal chat + // alice knows bob and messages appear in direct chat let mut msg = Message::new_text("this is the text!".to_string()); let msg1 = alice .recv_msg(&bob.send_msg(bob_chat_id, &mut msg).await) diff --git a/src/mimefactory.rs b/src/mimefactory.rs index 3ee7f3592..838f9b062 100644 --- a/src/mimefactory.rs +++ b/src/mimefactory.rs @@ -1293,7 +1293,7 @@ impl MimeFactory { let mut placeholdertext = None; let send_verified_headers = match chat.typ { - Chattype::Single => true, + Chattype::Direct => true, Chattype::Group => true, // Mailinglists and broadcast channels can actually never be verified: Chattype::Mailinglist => false, diff --git a/src/mimeparser.rs b/src/mimeparser.rs index eda7f8540..711c36b47 100644 --- a/src/mimeparser.rs +++ b/src/mimeparser.rs @@ -225,11 +225,11 @@ pub enum SystemMessage { /// which is sent by chatmail servers. InvalidUnencryptedMail = 13, - /// 1:1 chats info message telling that SecureJoin has started and the user should wait for it + /// Direct chats info message telling that SecureJoin has started and the user should wait for it /// to complete. SecurejoinWait = 14, - /// 1:1 chats info message telling that SecureJoin is still running, but the user may already + /// Direct chats info message telling that SecureJoin is still running, but the user may already /// send messages. SecurejoinWaitTimeout = 15, diff --git a/src/receive_imf.rs b/src/receive_imf.rs index e9f0d20b7..684bd13a1 100644 --- a/src/receive_imf.rs +++ b/src/receive_imf.rs @@ -143,14 +143,14 @@ enum ChatAssignment { chat_id_blocked: Blocked, }, - /// 1:1 chat with a single contact. + /// Direct chat with a single contact. /// /// The chat may be encrypted or not, /// it does not matter. /// It is not possible to mix /// email address contacts - /// with key-contacts in a single 1:1 chat anyway. - OneOneChat, + /// with key-contacts in a single direct chat anyway. + DirectChat, } /// Emulates reception of a message from the network. @@ -208,7 +208,7 @@ async fn get_to_and_past_contact_ids( // Note that this is not necessarily the chat we want to assign the message to. // In case of an outgoing private reply to a group message we may // lookup the address of receipient in the list of addresses used in the group, - // but want to assign the message to 1:1 chat. + // but want to assign the message to a direct chat. let chat_id = match chat_assignment { ChatAssignment::Trash => None, ChatAssignment::GroupChat { grpid } => { @@ -227,7 +227,7 @@ async fn get_to_and_past_contact_ids( } ChatAssignment::ExistingChat { chat_id, .. } => Some(*chat_id), ChatAssignment::MailingListOrBroadcast => None, - ChatAssignment::OneOneChat => { + ChatAssignment::DirectChat => { if !mime_parser.incoming { parent_message.as_ref().map(|m| m.chat_id) } else { @@ -356,8 +356,8 @@ async fn get_to_and_past_contact_ids( } // Sometimes, messages are sent just to a single recipient // in a broadcast (e.g. securejoin messages). - // In this case, we need to look them up like in a 1:1 chat: - ChatAssignment::OneOneChat | ChatAssignment::MailingListOrBroadcast => { + // In this case, we need to look them up like in a direct chat: + ChatAssignment::DirectChat | ChatAssignment::MailingListOrBroadcast => { let pgp_to_ids = add_or_lookup_key_contacts( context, &mime_parser.recipients, @@ -372,7 +372,7 @@ async fn get_to_and_past_contact_ids( { // There is a single recipient and we have // mapped it to a key contact. - // This is an encrypted 1:1 chat. + // This is an encrypted direct chat. to_ids = pgp_to_ids } else { let ids = if mime_parser.was_encrypted() { @@ -610,7 +610,7 @@ pub(crate) async fn receive_imf_inner( // // This can be also used to lookup // key-contact by email address - // when receiving a private 1:1 reply + // when receiving a direct reply // to a group chat message. let parent_message = get_parent_message( context, @@ -1325,12 +1325,12 @@ async fn decide_chat_assignment( num_recipients += 1; } } - let mut can_be_11_chat_log = String::new(); + let mut can_be_direct_chat_log = String::new(); let mut l = |cond: bool, s: String| { - can_be_11_chat_log += &s; + can_be_direct_chat_log += &s; cond }; - let can_be_11_chat = l( + let can_be_direct_chat = l( num_recipients <= 1, format!("num_recipients={num_recipients}."), ) && (l(from_id != ContactId::SELF, format!(" from_id={from_id}.")) @@ -1394,21 +1394,21 @@ async fn decide_chat_assignment( } else if mime_parser.get_header(HeaderDef::ChatGroupName).is_some() { chat_assignment_log = "Reply with Chat-Group-Name.".to_string(); ChatAssignment::AdHocGroup - } else if can_be_11_chat { - chat_assignment_log = format!("Non-group reply. {can_be_11_chat_log}"); - ChatAssignment::OneOneChat + } else if can_be_direct_chat { + chat_assignment_log = format!("Non-group reply. {can_be_direct_chat_log}"); + ChatAssignment::DirectChat } else { - chat_assignment_log = format!("Non-group reply. {can_be_11_chat_log}"); + chat_assignment_log = format!("Non-group reply. {can_be_direct_chat_log}"); ChatAssignment::AdHocGroup } } else if mime_parser.get_header(HeaderDef::ChatGroupName).is_some() { chat_assignment_log = "Message with Chat-Group-Name, no parent.".to_string(); ChatAssignment::AdHocGroup - } else if can_be_11_chat { - chat_assignment_log = format!("Non-group message, no parent. {can_be_11_chat_log}"); - ChatAssignment::OneOneChat + } else if can_be_direct_chat { + chat_assignment_log = format!("Non-group message, no parent. {can_be_direct_chat_log}"); + ChatAssignment::DirectChat } else { - chat_assignment_log = format!("Non-group message, no parent. {can_be_11_chat_log}"); + chat_assignment_log = format!("Non-group message, no parent. {can_be_direct_chat_log}"); ChatAssignment::AdHocGroup }; @@ -1448,14 +1448,14 @@ async fn do_chat_assignment( let mut chat_created = false; if mime_parser.incoming { - let test_normal_chat = ChatIdBlocked::lookup_by_contact(context, from_id).await?; + let test_direct_chat = ChatIdBlocked::lookup_by_contact(context, from_id).await?; let create_blocked_default = if is_bot { Blocked::Not } else { Blocked::Request }; - let create_blocked = if let Some(ChatIdBlocked { id: _, blocked }) = test_normal_chat { + let create_blocked = if let Some(ChatIdBlocked { id: _, blocked }) = test_direct_chat { match blocked { Blocked::Request => create_blocked_default, Blocked::Not => Blocked::Not, @@ -1465,8 +1465,8 @@ async fn do_chat_assignment( // Block the group contact created as well. Blocked::Yes } else { - // 1:1 chat is blocked, but the contact is not. - // This happens when 1:1 chat is hidden + // Direct chat is blocked, but the contact is not. + // This happens when direct chat is hidden // during scanning of a group invitation code. create_blocked_default } @@ -1485,7 +1485,7 @@ async fn do_chat_assignment( if let Some((id, blocked)) = chat::get_chat_id_by_grpid(context, grpid).await? { chat_id = Some(id); chat_id_blocked = blocked; - } else if (allow_creation || test_normal_chat.is_some()) + } else if (allow_creation || test_direct_chat.is_some()) && let Some((new_chat_id, new_chat_id_blocked)) = create_group( context, mime_parser, @@ -1535,7 +1535,7 @@ async fn do_chat_assignment( context, mime_parser, to_ids, - allow_creation || test_normal_chat.is_some(), + allow_creation || test_direct_chat.is_some(), create_blocked, ) .await? @@ -1545,7 +1545,7 @@ async fn do_chat_assignment( chat_created = new_created; } } - ChatAssignment::OneOneChat => {} + ChatAssignment::DirectChat => {} } // if the chat is somehow blocked but we want to create a non-blocked chat, @@ -1560,7 +1560,7 @@ async fn do_chat_assignment( } if chat_id.is_none() { - // Try to create a 1:1 chat. + // Try to create a direct chat. let contact = Contact::get_by_id(context, from_id).await?; let create_blocked = match contact.is_blocked() { true => Blocked::Yes, @@ -1568,7 +1568,7 @@ async fn do_chat_assignment( false => Blocked::Request, }; - if let Some(chat) = test_normal_chat { + if let Some(chat) = test_direct_chat { chat_id = Some(chat.id); chat_id_blocked = chat.blocked; } else if allow_creation { @@ -1689,7 +1689,7 @@ async fn do_chat_assignment( chat_created = new_chat_created; } } - ChatAssignment::OneOneChat => {} + ChatAssignment::DirectChat => {} } if !to_ids.is_empty() { @@ -1823,7 +1823,7 @@ async fn add_parts( let is_location_kml = mime_parser.location_kml.is_some(); let mut group_changes = match chat.typ { _ if chat.id.is_special() => GroupChangesInfo::default(), - Chattype::Single => GroupChangesInfo::default(), + Chattype::Direct => GroupChangesInfo::default(), Chattype::Mailinglist => GroupChangesInfo::default(), Chattype::OutBroadcast => { apply_out_broadcast_changes(context, mime_parser, &mut chat, from_id).await? @@ -2666,11 +2666,11 @@ async fn lookup_chat_by_reply( return Ok(None); } - // If the parent chat is a 1:1 chat, and the sender added - // a new person to TO/CC, then the message should not go to the 1:1 chat, but to a + // If the parent chat is a direct chat, and the sender added + // a new person to TO/CC, then the message should not go to the direct chat, but to a // newly created ad-hoc group. let parent_chat = Chat::load_from_db(context, parent_chat_id).await?; - if parent_chat.typ == Chattype::Single && mime_parser.recipients.len() > 1 { + if parent_chat.typ == Chattype::Direct && mime_parser.recipients.len() > 1 { return Ok(None); } @@ -2793,7 +2793,7 @@ async fn lookup_or_create_adhoc_group( .map(|(chat_id, blocked)| (chat_id, blocked, true))) } -/// If this method returns true, the message shall be assigned to the 1:1 chat with the sender. +/// If this method returns true, the message shall be assigned to the direct chat with the sender. /// If it returns false, it shall be assigned to the parent chat. async fn is_probably_private_reply( context: &Context, @@ -2806,7 +2806,7 @@ async fn is_probably_private_reply( } // Usually we don't want to show private replies in the parent chat, but in the - // 1:1 chat with the sender. + // direct chat with the sender. // // There is one exception: Classical MUA replies to two-member groups // should be assigned to the group chat. We restrict this exception to classical emails, as chat-group-messages @@ -2919,7 +2919,7 @@ async fn create_group( // yet unknown group, which was rejected because // Chat-Group-Name, which is in the encrypted part, was // not found. We can't create a properly named group in - // this case, so assign error message to 1:1 chat with the + // this case, so assign error message to a direct chat with the // sender instead. Ok(None) } else { @@ -3575,7 +3575,7 @@ async fn create_or_lookup_mailinglist_or_broadcast( name, if chattype == Chattype::InBroadcast { // If we joined the broadcast, we have scanned a QR code. - // Even if 1:1 chat does not exist or is in a contact request, + // Even if a direct chat does not exist or is in a contact request, // create the channel as unblocked. Blocked::Not } else { @@ -4279,7 +4279,7 @@ async fn lookup_key_contact_by_address( ", ( addr, - Chattype::Single, + Chattype::Direct, constants::DC_CHAT_ID_LAST_SPECIAL, Blocked::Not, ), diff --git a/src/receive_imf/receive_imf_tests.rs b/src/receive_imf/receive_imf_tests.rs index cc6c8af5b..6f1acc105 100644 --- a/src/receive_imf/receive_imf_tests.rs +++ b/src/receive_imf/receive_imf_tests.rs @@ -58,7 +58,7 @@ static MSGRMSG: &[u8] = \n\ hello\n"; -static ONETOONE_NOREPLY_MAIL: &[u8] = +static DIRECT_NOREPLY_MAIL: &[u8] = b"Received: (Postfix, from userid 1000); Mon, 4 Dec 2006 14:51:39 +0100 (CET)\n\ From: Bob \n\ To: alice@example.org\n\ @@ -90,7 +90,7 @@ async fn test_adhoc_group_is_shown() { let chats = Chatlist::try_load(&t, 0, None, None).await.unwrap(); assert_eq!(chats.len(), 1); - receive_imf(&t, ONETOONE_NOREPLY_MAIL, false).await.unwrap(); + receive_imf(&t, DIRECT_NOREPLY_MAIL, false).await.unwrap(); let chats = Chatlist::try_load(&t, 0, None, None).await.unwrap(); assert_eq!(chats.len(), 1); @@ -114,13 +114,13 @@ async fn test_adhoc_group_show_accepted_contact_accepted() { assert!(chat.is_contact_request()); chat_id.accept(&t).await.unwrap(); let chat = chat::Chat::load_from_db(&t, chat_id).await.unwrap(); - assert_eq!(chat.typ, Chattype::Single); + assert_eq!(chat.typ, Chattype::Direct); assert_eq!(chat.name, "Bob"); assert_eq!(chat::get_chat_contacts(&t, chat_id).await.unwrap().len(), 1); assert_eq!(chat::get_chat_msgs(&t, chat_id).await.unwrap().len(), 1); // receive a non-delta-message from Bob, shows up because of the show_emails setting - receive_imf(&t, ONETOONE_NOREPLY_MAIL, false).await.unwrap(); + receive_imf(&t, DIRECT_NOREPLY_MAIL, false).await.unwrap(); assert_eq!(chat::get_chat_msgs(&t, chat_id).await.unwrap().len(), 2); @@ -1757,7 +1757,7 @@ async fn check_alias_reply(from_dc: bool, chat_request: bool, group_request: boo if group_request { assert_eq!(chat.typ, Chattype::Group); } else { - assert_eq!(chat.typ, Chattype::Single); + assert_eq!(chat.typ, Chattype::Direct); } assert_eq!(get_chat_msgs(&claire, chat.id).await.unwrap().len(), 1); assert_eq!(msg.get_override_sender_name(), None); @@ -2157,7 +2157,7 @@ Original signature", ) .await?; let msg = t.get_last_msg().await; - let one2one_chat_id = msg.chat_id; + let direct_chat_id = msg.chat_id; let bob = Contact::get_by_id(&t, bob_id).await?; assert_eq!(bob.get_status(), "Original signature"); assert!(!msg.has_html()); @@ -2200,7 +2200,7 @@ Original signature updated", .await?; let bob = Contact::get_by_id(&t, bob_id).await?; assert_eq!(bob.get_status(), "Original signature updated"); - assert_eq!(get_chat_msgs(&t, one2one_chat_id).await?.len(), 2); + assert_eq!(get_chat_msgs(&t, direct_chat_id).await?.len(), 2); assert_eq!(get_chat_msgs(&t, ml_chat_id).await?.len(), 1); assert_eq!(Chatlist::try_load(&t, 0, None, None).await?.len(), 2); Ok(()) @@ -2358,7 +2358,7 @@ Private reply"#, let private_msg = t.get_last_msg().await; assert_eq!(private_msg.text, "Private reply"); let private_chat = Chat::load_from_db(t, private_msg.chat_id).await.unwrap(); - assert_eq!(private_chat.typ, Chattype::Single); + assert_eq!(private_chat.typ, Chattype::Direct); assert_ne!(private_msg.chat_id, group_msg.chat_id); } } @@ -2454,7 +2454,7 @@ Sent with my Delta Chat Messenger: https://delta.chat let private_msg = t.get_last_msg().await; assert_eq!(private_msg.text, "Private reply"); let private_chat = Chat::load_from_db(t, private_msg.chat_id).await.unwrap(); - assert_eq!(private_chat.typ, Chattype::Single); + assert_eq!(private_chat.typ, Chattype::Direct); assert_ne!(private_msg.chat_id, group_msg.chat_id); } } @@ -3068,7 +3068,7 @@ async fn test_outgoing_private_reply_multidevice() -> Result<()> { assert_eq!(received.chat_blocked, Blocked::Not); let received_chat = Chat::load_from_db(&alice2, received.chat_id).await?; - assert_eq!(received_chat.typ, Chattype::Single); + assert_eq!(received_chat.typ, Chattype::Direct); assert_eq!(received_chat.name, "bob@example.net"); assert_eq!(received_chat.can_send(&alice2).await?, true); @@ -3266,7 +3266,7 @@ async fn test_no_private_reply_to_blocked_account() -> Result<()> { assert_eq!(chats.len(), 2); let chat_id = chats.get_chat_id(0).unwrap(); let chat = Chat::load_from_db(&bob, chat_id).await.unwrap(); - assert_eq!(chat.typ, Chattype::Single); + assert_eq!(chat.typ, Chattype::Direct); let received = bob.get_last_msg().await; assert_eq!(received.text, "Private reply"); @@ -3275,7 +3275,7 @@ async fn test_no_private_reply_to_blocked_account() -> Result<()> { /// Regression test for two bugs: /// -/// 1. If you blocked some spammer using DC, the 1:1 messages with that contact +/// 1. If you blocked some spammer using DC, the direct messages with that contact /// are not received, but they could easily bypass this restriction creating /// a new group with only you two as member. /// 2. A blocked group was sometimes not unblocked when when an unblocked @@ -3700,11 +3700,11 @@ async fn test_mua_user_adds_member() -> Result<()> { } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] -async fn test_mua_user_adds_recipient_to_single_chat() -> Result<()> { +async fn test_mua_user_adds_recipient_to_direct_chat() -> Result<()> { let alice = TestContext::new_alice().await; alice.allow_unencrypted().await?; - // Alice sends a 1:1 message to Bob, creating a 1:1 chat. + // Alice sends a direct message to Bob, creating a direct chat. let msg = receive_imf( &alice, b"Subject: =?utf-8?q?Message_from_alice=40example=2Eorg?=\r\n\ @@ -3719,10 +3719,10 @@ async fn test_mua_user_adds_recipient_to_single_chat() -> Result<()> { ) .await? .unwrap(); - let single_chat = Chat::load_from_db(&alice, msg.chat_id).await?; - assert_eq!(single_chat.typ, Chattype::Single); + let direct_chat = Chat::load_from_db(&alice, msg.chat_id).await?; + assert_eq!(direct_chat.typ, Chattype::Direct); - // Bob uses a classical MUA to answer in the 1:1 chat. + // Bob uses a classical MUA to answer in the direct chat. let msg2 = receive_imf( &alice, b"Subject: Re: Message from alice\r\n\ @@ -3737,7 +3737,7 @@ async fn test_mua_user_adds_recipient_to_single_chat() -> Result<()> { ) .await? .unwrap(); - assert_eq!(msg2.chat_id, single_chat.id); + assert_eq!(msg2.chat_id, direct_chat.id); // Bob uses a classical MUA to answer again, this time adding a recipient. // This message should go to a newly created ad-hoc group. @@ -3755,13 +3755,10 @@ async fn test_mua_user_adds_recipient_to_single_chat() -> Result<()> { ) .await? .unwrap(); - assert_ne!(msg3.chat_id, single_chat.id); + assert_ne!(msg3.chat_id, direct_chat.id); let group_chat = Chat::load_from_db(&alice, msg3.chat_id).await?; assert_eq!(group_chat.typ, Chattype::Group); - assert_eq!( - chat::get_chat_contacts(&alice, group_chat.id).await?.len(), - 3 - ); + assert_eq!(get_chat_contacts(&alice, group_chat.id).await?.len(), 3); // Bob uses a classical MUA to answer once more, adding another recipient. // This new recipient should also be added to the group. @@ -3780,15 +3777,12 @@ async fn test_mua_user_adds_recipient_to_single_chat() -> Result<()> { .await? .unwrap(); assert_eq!(msg4.chat_id, group_chat.id); - assert_eq!( - chat::get_chat_contacts(&alice, group_chat.id).await?.len(), - 4 - ); + assert_eq!(get_chat_contacts(&alice, group_chat.id).await?.len(), 4); let fiona_contact_id = Contact::lookup_id_by_addr(&alice, "fiona@example.net", Origin::IncomingTo) .await? .unwrap(); - assert!(chat::is_contact_in_chat(&alice, group_chat.id, fiona_contact_id).await?); + assert!(is_contact_in_chat(&alice, group_chat.id, fiona_contact_id).await?); let fiona_contact = Contact::get_by_id(&alice, fiona_contact_id).await?; assert_eq!(fiona_contact.is_key_contact(), false); @@ -5154,7 +5148,7 @@ async fn test_dont_verify_by_verified_by_unknown() -> Result<()> { } /// Tests that second device assigns outgoing encrypted messages -/// to 1:1 chat with key-contact even if the key of the contact is unknown. +/// to a direct chat with key-contact even if the key of the contact is unknown. #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn test_recv_outgoing_msg_before_securejoin() -> Result<()> { let mut tcm = TestContextManager::new(); @@ -5167,13 +5161,13 @@ async fn test_recv_outgoing_msg_before_securejoin() -> Result<()> { let sent_msg = a0.send_text(chat_id_a0_bob, "Hi").await; // Device a1 does not have Bob's key. - // Message is still received in an encrypted 1:1 chat with Bob. + // Message is still received in an encrypted direct chat with Bob. // a1 learns the fingerprint of Bob from the Intended Recipient Fingerprint packet, // but not the key. let msg_a1 = a1.recv_msg(&sent_msg).await; assert!(msg_a1.get_showpadlock()); let chat_a1 = Chat::load_from_db(a1, msg_a1.chat_id).await?; - assert_eq!(chat_a1.typ, Chattype::Single); + assert_eq!(chat_a1.typ, Chattype::Direct); assert!(chat_a1.is_encrypted(a1).await?); // Cannot send because a1 does not have Bob's key. @@ -5194,7 +5188,7 @@ async fn test_recv_outgoing_msg_before_securejoin() -> Result<()> { Ok(()) } -/// Tests that outgoing message cannot be assigned to 1:1 chat +/// Tests that outgoing message cannot be assigned to a direct chat /// without the intended recipient fingerprint. #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn test_recv_outgoing_msg_no_intended_recipient_fingerprint() -> Result<()> { @@ -5548,7 +5542,7 @@ async fn test_encrypted_adhoc_group_message() -> Result<()> { /// Tests that messages sent to unencrypted group /// with only two members arrive in a group -/// and not in 1:1 chat. +/// and not in a direct chat. #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn test_small_unencrypted_group() -> Result<()> { let mut tcm = TestContextManager::new(); @@ -5606,7 +5600,7 @@ async fn test_bcc_not_a_group() -> Result<()> { .unwrap(); let received_chat = Chat::load_from_db(alice, received.chat_id).await?; - assert_eq!(received_chat.typ, Chattype::Single); + assert_eq!(received_chat.typ, Chattype::Direct); Ok(()) } diff --git a/src/securejoin.rs b/src/securejoin.rs index 3ab31805d..0c9af8f18 100644 --- a/src/securejoin.rs +++ b/src/securejoin.rs @@ -657,7 +657,7 @@ pub(crate) async fn handle_securejoin_handshake( return Ok(HandshakeMessage::Ignore); } contact_id.regossip_keys(context).await?; - // for setup-contact, make Alice's one-to-one chat with Bob visible + // for setup-contact, make Alice's direct chat with Bob visible // (secure-join-information are shown in the group chat) if grpid.is_empty() { ChatId::create_for_contact(context, contact_id).await?; @@ -689,7 +689,7 @@ pub(crate) async fn handle_securejoin_handshake( .await .context("failed sending vc-contact-confirm message")?; - inviter_progress(context, contact_id, chat_id, Chattype::Single)?; + inviter_progress(context, contact_id, chat_id, Chattype::Direct)?; Ok(HandshakeMessage::Ignore) // "Done" would delete the message and break multi-device (the key from Autocrypt-header is needed) } } @@ -842,7 +842,7 @@ pub(crate) async fn observe_securejoin_on_other_device( .get_header(HeaderDef::ChatGroupMemberAdded) .is_none() { - Chattype::Single + Chattype::Direct } else if mime_message.get_header(HeaderDef::ListId).is_some() { Chattype::OutBroadcast } else { diff --git a/src/securejoin/bob.rs b/src/securejoin/bob.rs index e4d64556f..0a9300110 100644 --- a/src/securejoin/bob.rs +++ b/src/securejoin/bob.rs @@ -43,10 +43,10 @@ use crate::{chatlist_events, mimefactory}; /// /// # Returns /// -/// The [`ChatId`] of the created chat is returned, for a SetupContact QR this is the 1:1 +/// The [`ChatId`] of the created chat is returned, for a SetupContact QR this is the direct /// chat with Alice, for a SecureJoin QR this is the group chat. pub(super) async fn start_protocol(context: &Context, invite: QrInvite) -> Result { - // A 1:1 chat is needed to send messages to Alice. When joining a group this chat is + // A direct chat is needed to send messages to Alice. When joining a group this chat is // hidden, if a user starts sending messages in it it will be unhidden in // receive_imf. let private_chat_id = private_chat_id(context, &invite).await?; @@ -168,7 +168,7 @@ pub(super) async fn start_protocol(context: &Context, invite: QrInvite) -> Resul Ok(joining_chat_id) } QrInvite::Contact { .. } => { - // For setup-contact the BobState already ensured the 1:1 chat exists because it is + // For setup-contact the BobState already ensured the direct chat exists because it is // used to send the handshake messages. if !key_contains_all_invite_addrs { chat::add_info_msg_with_cmd( @@ -288,7 +288,7 @@ pub(super) async fn handle_auth_required_or_pubkey( QrInvite::Contact { .. } | QrInvite::Broadcast { .. } => {} QrInvite::Group { .. } => { // The message reads "Alice replied, waiting to be added to the group…", - // so only show it when joining a group and not for a 1:1 chat or broadcast channel. + // so only show it when joining a group and not for a direct chat or broadcast channel. let contact_id = invite.contact_id(); let msg = stock_str::secure_join_replies(context, contact_id).await; let chat_id = joining_chat_id(context, &invite, chat_id).await?; @@ -430,10 +430,10 @@ impl BobHandshakeMsg { } } -/// Returns the 1:1 chat with the inviter. +/// Returns the direct chat with the inviter. /// /// This is the chat in which securejoin messages are sent. -/// The 1:1 chat will be created if it does not yet exist. +/// The direct chat will be created if it does not yet exist. async fn private_chat_id(context: &Context, invite: &QrInvite) -> Result { let hidden = match invite { QrInvite::Contact { .. } => Blocked::Not, @@ -451,7 +451,7 @@ async fn private_chat_id(context: &Context, invite: &QrInvite) -> Result /// This is the chat in which you want to notify the user as well. /// /// When joining a group this is the [`ChatId`] of the group chat, when verifying a -/// contact this is the [`ChatId`] of the 1:1 chat. +/// contact this is the [`ChatId`] of the direct chat. /// The group chat will be created if it does not yet exist. async fn joining_chat_id( context: &Context, diff --git a/src/securejoin/securejoin_tests.rs b/src/securejoin/securejoin_tests.rs index 8db2c0863..22ed87d1a 100644 --- a/src/securejoin/securejoin_tests.rs +++ b/src/securejoin/securejoin_tests.rs @@ -235,7 +235,7 @@ async fn test_setup_contact_ex(case: SetupContactCase) { assert!(contact_bob.get_name().is_empty()); assert_eq!(contact_bob.is_bot(), false); - // exactly one one-to-one chat should be visible for both now + // exactly one direct chat should be visible for both now // (check this before calling alice.get_chat() explicitly below) assert_eq!( Chatlist::try_load(&alice, 0, None, None) @@ -249,7 +249,7 @@ async fn test_setup_contact_ex(case: SetupContactCase) { 1 ); - // Check Alice got the verified message in her 1:1 chat. + // Check Alice got the verified message in her direct chat. { let chat = alice.get_chat(&bob).await; let msg = get_chat_msg(&alice, chat.get_id(), 0, 1).await; @@ -382,7 +382,7 @@ async fn test_setup_contact_bob_knows_alice() -> Result<()> { .. } => { assert_eq!(contact_id, contact_bob.id); - assert_eq!(chat_type, Chattype::Single); + assert_eq!(chat_type, Chattype::Direct); assert_eq!(progress, 1000); } _ => unreachable!(), @@ -421,7 +421,7 @@ async fn test_setup_contact_concurrent_calls() -> Result<()> { let claire_id = join_securejoin(&bob, qr_stale).await?; let chat = Chat::load_from_db(&bob, claire_id).await?; assert!(!claire_id.is_special()); - assert_eq!(chat.typ, Chattype::Single); + assert_eq!(chat.typ, Chattype::Direct); assert!(bob.pop_sent_msg().await.payload().contains("claire@foo.de")); // subsequent scans shall abort existing ones or run concurrently - @@ -430,7 +430,7 @@ async fn test_setup_contact_concurrent_calls() -> Result<()> { let alice_id = join_securejoin(&bob, &qr).await?; let chat = Chat::load_from_db(&bob, alice_id).await?; assert!(!alice_id.is_special()); - assert_eq!(chat.typ, Chattype::Single); + assert_eq!(chat.typ, Chattype::Direct); assert_ne!(claire_id, alice_id); assert_eq!( bob.pop_sent_msg() @@ -620,7 +620,7 @@ async fn test_secure_join_group_ex(v3: bool, remove_invite: bool) -> Result<()> assert_eq!( chat.blocked, Blocked::Yes, - "Alice's 1:1 chat with Bob is not hidden" + "Alice's direct chat with Bob is not hidden" ); } @@ -648,7 +648,7 @@ async fn test_secure_join_group_ex(v3: bool, remove_invite: bool) -> Result<()> assert_eq!( chat.blocked, Blocked::Yes, - "Bob's 1:1 chat with Alice is not hidden" + "Bob's direct chat with Alice is not hidden" ); for item in chat::get_chat_msgs(&bob.ctx, bob_chatid).await.unwrap() { if let chat::ChatItem::Message { msg_id } = item { @@ -667,12 +667,12 @@ async fn test_secure_join_group_ex(v3: bool, remove_invite: bool) -> Result<()> assert_eq!(chat::get_chat_contacts(&bob, bob_chatid).await?.len(), 2); // On this "happy path", Alice and Bob get only a group-chat where all information are added to. - // The one-to-one chats are used internally for the hidden handshake messages, + // The direct chats are used internally for the hidden handshake messages, // however, should not be visible in the UIs. assert_eq!(Chatlist::try_load(&alice, 0, None, None).await?.len(), 1); assert_eq!(Chatlist::try_load(&bob, 0, None, None).await?.len(), 1); - // If Bob then sends a direct message to alice, however, the one-to-one with Alice should appear. + // If Bob then sends a direct message to alice, however, the direct chat with Alice should appear. let bobs_chat_with_alice = bob.create_chat(&alice).await; let sent = bob.send_text(bobs_chat_with_alice.id, "Hello").await; alice.recv_msg(&sent).await; @@ -740,13 +740,13 @@ async fn test_setup_contact_compatibility_ex(v3: bool, remove_invite: bool) -> R let bob_chat = Chat::load_from_db(bob, bob_chat_id).await?; assert_eq!(bob_chat.name, "Alice"); assert!(bob_chat.can_send(bob).await?); - assert_eq!(bob_chat.typ, Chattype::Single); + assert_eq!(bob_chat.typ, Chattype::Direct); assert_eq!(bob_chat.id, bob.get_chat(alice).await.id); let alice_chat = alice.get_chat(bob).await; assert_eq!(alice_chat.name, "bob@example.net"); assert!(alice_chat.can_send(alice).await?); - assert_eq!(alice_chat.typ, Chattype::Single); + assert_eq!(alice_chat.typ, Chattype::Direct); Ok(()) } diff --git a/src/sql/migrations.rs b/src/sql/migrations.rs index d1f901b5c..584b1bc27 100644 --- a/src/sql/migrations.rs +++ b/src/sql/migrations.rs @@ -433,7 +433,7 @@ fn migrate_key_contacts( Ok(()) }; let old_and_new_members: Vec<(u32, bool, Option)> = match typ { - // 1:1 chats retain: + // Direct chats retain: // - address-contact if peerstate is in the "reset" state, // or if there is no key-contact that has the right email address. // - key-contact identified by the Autocrypt key if Autocrypt key does not match the verified key. @@ -444,7 +444,7 @@ fn migrate_key_contacts( let Some((old_member, _)) = old_members.first() else { info!( context, - "1:1 chat {chat_id} doesn't contain contact, probably it's self or device chat." + "Direct chat {chat_id} doesn't contain contact, probably it's self or device chat." ); continue; }; @@ -1802,7 +1802,7 @@ CREATE INDEX msgs_status_updates_index2 ON msgs_status_updates (uid); sql.execute_migration( "UPDATE chats SET protected=1 -- ProtectionStatus::Protected - WHERE type==100 -- Chattype::Single + WHERE type==100 -- Chattype::Direct AND EXISTS ( SELECT 1 FROM chats_contacts cc WHERE cc.chat_id==chats.id @@ -2390,7 +2390,7 @@ UPDATE msgs SET state=24 WHERE state=18; -- Change OutPreparing to OutFailed. sql.execute_migration_transaction( |transaction| { // Newest timestamp of message sent to unencrypted chat with contacts. - // This is for 1:1 chats and ad hoc groups. + // This is for direct chats and ad hoc groups. // // Corner case of ad hoc groups with only self as a member is ignored. let max_unencrypted_timestamp: i64 = transaction.query_row( diff --git a/src/stats.rs b/src/stats.rs index 264f449df..19952ebd1 100644 --- a/src/stats.rs +++ b/src/stats.rs @@ -163,7 +163,7 @@ struct JoinedInvite { /// this tells us whether the contact was verified already. already_verified: bool, /// The type of the invite: - /// "contact" for 1:1 invites that setup a verified contact, + /// "contact" for direct invites that setup a verified contact, /// "group" for invites that invite to a group, /// "broadcast" for invites that invite to a broadcast channel. /// The invite also performs the contact verification 'along the way'. @@ -524,7 +524,7 @@ async fn get_contact_stats(context: &Context, last_old_contact: u32) -> Result Result Result> { let mut map: BTreeMap = context @@ -562,7 +562,7 @@ async fn get_message_stats(context: &Context) -> Result Result Result<()> { - for chattype in [Chattype::Single, Chattype::Group, Chattype::OutBroadcast] { + for chattype in [Chattype::Direct, Chattype::Group, Chattype::OutBroadcast] { update_message_stats_inner(context, chattype).await?; } context @@ -650,7 +650,7 @@ async fn update_message_stats_inner(context: &Context, chattype: Chattype) -> Re (), )?; - // This table will hold all 1:1 chats. + // This table will hold all direct chats. t.execute( "CREATE TEMP TABLE temp.chat_with_correct_type ( id INTEGER PRIMARY KEY diff --git a/src/stats/stats_tests.rs b/src/stats/stats_tests.rs index 385892cf6..191ad31b0 100644 --- a/src/stats/stats_tests.rs +++ b/src/stats/stats_tests.rs @@ -156,7 +156,7 @@ async fn test_message_stats() -> Result<()> { let encrypted_chat = alice.create_chat(bob).await; let mut expected: BTreeMap = BTreeMap::from_iter([ - (Chattype::Single, MessageStats::default()), + (Chattype::Direct, MessageStats::default()), (Chattype::Group, MessageStats::default()), (Chattype::OutBroadcast, MessageStats::default()), ]); @@ -164,19 +164,19 @@ async fn test_message_stats() -> Result<()> { check_stats(&update_get_stats(alice).await, &expected); alice.send_text(email_chat.id, "foo").await; - expected.get_mut(&Chattype::Single).unwrap().unencrypted += 1; + expected.get_mut(&Chattype::Direct).unwrap().unencrypted += 1; check_stats(&update_get_stats(alice).await, &expected); alice.send_text(encrypted_chat.id, "foo").await; expected - .get_mut(&Chattype::Single) + .get_mut(&Chattype::Direct) .unwrap() .unverified_encrypted += 1; check_stats(&update_get_stats(alice).await, &expected); alice.send_text(encrypted_chat.id, "foo").await; expected - .get_mut(&Chattype::Single) + .get_mut(&Chattype::Direct) .unwrap() .unverified_encrypted += 1; check_stats(&update_get_stats(alice).await, &expected); @@ -193,7 +193,7 @@ async fn test_message_stats() -> Result<()> { check_stats(&update_get_stats(alice).await, &expected); alice.send_text(alice.get_self_chat().await.id, "foo").await; - expected.get_mut(&Chattype::Single).unwrap().only_to_self += 1; + expected.get_mut(&Chattype::Direct).unwrap().only_to_self += 1; check_stats(&update_get_stats(alice).await, &expected); let empty_group = create_group(alice, "Notes").await?; @@ -245,13 +245,13 @@ async fn test_message_stats() -> Result<()> { SystemTime::shift(Duration::from_secs(8 * 24 * 3600)); tcm.send_recv(alice, bob, "Hi").await; - expected.get_mut(&Chattype::Single).unwrap().verified += 1; + expected.get_mut(&Chattype::Direct).unwrap().verified += 1; update_message_stats(alice).await?; update_message_stats(alice).await?; tcm.send_recv(alice, bob, "Hi").await; - expected.get_mut(&Chattype::Single).unwrap().verified += 1; + expected.get_mut(&Chattype::Direct).unwrap().verified += 1; tcm.send_recv(alice, bob, "Hi").await; - expected.get_mut(&Chattype::Single).unwrap().verified += 1; + expected.get_mut(&Chattype::Direct).unwrap().verified += 1; check_stats(&send_and_read_stats(alice).await, &expected); diff --git a/src/test_utils.rs b/src/test_utils.rs index f5f245c8a..ecbc10b26 100644 --- a/src/test_utils.rs +++ b/src/test_utils.rs @@ -242,7 +242,7 @@ impl TestContextManager { /// Executes SecureJoin protocol between `scanner` and `scanned`. /// - /// Returns chat ID of the 1:1 chat for `scanner`. + /// Returns chat ID of the direct chat for `scanner`. pub async fn execute_securejoin(&self, scanner: &TestContext, scanned: &TestContext) -> ChatId { self.section(&format!( "{} scans {}'s QR code", @@ -256,7 +256,7 @@ impl TestContextManager { /// Executes SecureJoin initiated by `joiner` scanning `qr` generated by `inviter`. /// - /// The [`ChatId`] of the created chat is returned, for a SetupContact QR this is the 1:1 + /// The [`ChatId`] of the created chat is returned, for a SetupContact QR this is the direct /// chat with `inviter`, for a SecureJoin QR this is the group chat. pub async fn exec_securejoin_qr( &self, @@ -273,7 +273,7 @@ impl TestContextManager { /// `inviters` devices must have the same primary address. /// All of the `inviters` devices will get the messages and send replies. /// - /// The [`ChatId`] of the created chat is returned, for a SetupContact QR this is the 1:1 + /// The [`ChatId`] of the created chat is returned, for a SetupContact QR this is the direct /// chat with the inviter, for a SecureJoin QR this is the group chat. pub async fn exec_securejoin_qr_multi_device( &self, @@ -951,12 +951,12 @@ ORDER BY id" contact_id } - /// Returns 1:1 [`Chat`] with another account address-contact. + /// Returns a direct [`Chat`] with another account address-contact. /// Panics if it doesn't exist. /// May return a blocked chat. /// /// This first creates a contact using the configured details on the other account, then - /// gets the 1:1 chat with this contact. + /// gets the direct chat with this contact. pub async fn get_email_chat(&self, other: &TestContext) -> Chat { let contact = self.add_or_lookup_address_contact(other).await; @@ -972,7 +972,7 @@ ORDER BY id" Chat::load_from_db(&self.ctx, chat_id).await.unwrap() } - /// Returns 1:1 [`Chat`] with another account key-contact. + /// Returns a direct [`Chat`] with another account key-contact. /// Panics if the chat does not exist. /// /// This first creates a contact, but does not import the key, @@ -993,27 +993,27 @@ ORDER BY id" Chat::load_from_db(&self.ctx, chat_id).await.unwrap() } - /// Creates or returns an existing 1:1 [`ChatId`] with another account. + /// Creates or returns an existing direct [`ChatId`] with another account. /// /// This first creates a contact by exporting a vCard from the `other` /// and importing it into `self`, - /// then creates a 1:1 chat with this contact. + /// then creates a direct chat with this contact. pub async fn create_chat_id(&self, other: &TestContext) -> ChatId { let contact_id = self.add_or_lookup_contact_id(other).await; ChatId::create_for_contact(self, contact_id).await.unwrap() } - /// Creates or returns an existing 1:1 [`Chat`] with another account. + /// Creates or returns an existing direct [`Chat`] with another account. /// /// This first creates a contact by exporting a vCard from the `other` /// and importing it into `self`, - /// then creates a 1:1 chat with this contact. + /// then creates a direct chat with this contact. pub async fn create_chat(&self, other: &TestContext) -> Chat { let chat_id = self.create_chat_id(other).await; Chat::load_from_db(self, chat_id).await.unwrap() } - /// Creates or returns an existing 1:1 [`Chat`] with another account + /// Creates or returns an existing direct [`Chat`] with another account /// by email address. /// /// This function can be used to create unencrypted chats. @@ -1024,9 +1024,9 @@ ORDER BY id" Chat::load_from_db(self, chat_id).await.unwrap() } - /// Creates or returns an existing [`Contact`] and 1:1 [`Chat`] with another email. + /// Creates or returns an existing [`Contact`] and direct [`Chat`] with another email. /// - /// This first creates a contact from the `name` and `addr` and then creates a 1:1 chat + /// This first creates a contact from the `name` and `addr` and then creates a direct chat /// with this contact. pub async fn create_chat_with_contact(&self, name: &str, addr: &str) -> Chat { let contact = Contact::create(self, name, addr) @@ -1138,7 +1138,7 @@ ORDER BY id" let members = chat::get_chat_contacts(self, sel_chat.id).await.unwrap(); let subtitle = if sel_chat.is_device_talk() { "device-talk".to_string() - } else if sel_chat.get_type() == Chattype::Single && !members.is_empty() { + } else if sel_chat.get_type() == Chattype::Direct && !members.is_empty() { let contact = Contact::get_by_id(self, members[0]).await.unwrap(); if contact.is_key_contact() { format!("KEY {}", contact.get_addr()) diff --git a/src/tests/aeap.rs b/src/tests/aeap.rs index 8d8724dca..eccf73f45 100644 --- a/src/tests/aeap.rs +++ b/src/tests/aeap.rs @@ -44,7 +44,7 @@ async fn test_change_primary_self_addr() -> Result<()> { } enum ChatForTransition { - OneToOne, + Direct, GroupChat, VerifiedGroup, } @@ -52,7 +52,7 @@ use ChatForTransition::*; #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn test_aeap_transition_0() { - check_aeap_transition(OneToOne, false).await; + check_aeap_transition(Direct, false).await; } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn test_aeap_transition_1() { @@ -60,7 +60,7 @@ async fn test_aeap_transition_1() { } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn test_aeap_transition_0_verified() { - check_aeap_transition(OneToOne, true).await; + check_aeap_transition(Direct, true).await; } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn test_aeap_transition_1_verified() { @@ -123,7 +123,7 @@ async fn check_aeap_transition(chat_for_transition: ChatForTransition, verified: tcm.section("Alice sends another message to Bob, this time from her new addr"); // No matter which chat Alice sends to, the transition should be done in all groups let chat_to_send = match chat_for_transition { - OneToOne => alice.create_chat(bob).await.id, + Direct => alice.create_chat(bob).await.id, GroupChat => group1_alice, VerifiedGroup => group3_alice.expect("No verified group"), }; diff --git a/src/tests/verified_chats.rs b/src/tests/verified_chats.rs index c81b4ff5f..8d8a0caa4 100644 --- a/src/tests/verified_chats.rs +++ b/src/tests/verified_chats.rs @@ -22,16 +22,16 @@ use crate::test_utils::{ use crate::tools::SystemTime; #[tokio::test(flavor = "multi_thread", worker_threads = 2)] -async fn test_verified_oneonone_chat_not_broken_by_classical() { - check_verified_oneonone_chat_protection_not_broken(true).await; +async fn test_verified_direct_chat_not_broken_by_classical() { + check_verified_direct_chat_protection_not_broken(true).await; } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] -async fn test_verified_oneonone_chat_not_broken_by_device_change() { - check_verified_oneonone_chat_protection_not_broken(false).await; +async fn test_verified_direct_chat_not_broken_by_device_change() { + check_verified_direct_chat_protection_not_broken(false).await; } -async fn check_verified_oneonone_chat_protection_not_broken(by_classical_email: bool) { +async fn check_verified_direct_chat_protection_not_broken(by_classical_email: bool) { let mut tcm = TestContextManager::new(); let alice = tcm.alice().await; let bob = tcm.bob().await; @@ -83,7 +83,7 @@ async fn check_verified_oneonone_chat_protection_not_broken(by_classical_email: } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] -async fn test_create_verified_oneonone_chat() -> Result<()> { +async fn test_create_verified_direct_chat() -> Result<()> { let mut tcm = TestContextManager::new(); let alice = tcm.alice().await; let bob = tcm.bob().await; @@ -168,11 +168,11 @@ async fn test_missing_key_reexecute_securejoin() -> Result<()> { } /// Tests that receiving unencrypted message -/// does not disable protection of 1:1 chat. +/// does not disable protection of direct chat. /// /// Instead, an email-chat is created. #[tokio::test(flavor = "multi_thread", worker_threads = 2)] -async fn test_degrade_verified_oneonone_chat() -> Result<()> { +async fn test_degrade_verified_direct_chat() -> Result<()> { let mut tcm = TestContextManager::new(); let alice = &tcm.alice().await; let bob = &tcm.bob().await; diff --git a/test-data/golden/receive_imf_older_message_from_2nd_device b/test-data/golden/receive_imf_older_message_from_2nd_device index a89a4f685..b965e7430 100644 --- a/test-data/golden/receive_imf_older_message_from_2nd_device +++ b/test-data/golden/receive_imf_older_message_from_2nd_device @@ -1,4 +1,4 @@ -Single#Chat#1001: bob@example.net [bob@example.net] Icon: 4138c52e5bc1c576cda7dd44d088c07.png +Direct#Chat#1001: bob@example.net [bob@example.net] Icon: 4138c52e5bc1c576cda7dd44d088c07.png -------------------------------------------------------------------------------- Msg#1002: Me (Contact#Contact#Self): I'm Alice too √ Msg#1001: Me (Contact#Contact#Self): We share this account √ diff --git a/test-data/golden/test_broadcast_joining_golden_private_chat b/test-data/golden/test_broadcast_joining_golden_private_chat index a77ef169a..2b9717f18 100644 --- a/test-data/golden/test_broadcast_joining_golden_private_chat +++ b/test-data/golden/test_broadcast_joining_golden_private_chat @@ -1,4 +1,4 @@ -Single#Chat#1002: bob@example.net [KEY bob@example.net] +Direct#Chat#1002: bob@example.net [KEY bob@example.net] -------------------------------------------------------------------------------- Msg#1007: info (Contact#Contact#Info): Messages are end-to-end encrypted. [NOTICED][INFO] -------------------------------------------------------------------------------- diff --git a/test-data/golden/test_old_message_1 b/test-data/golden/test_old_message_1 index d18664daf..6d3ee7627 100644 --- a/test-data/golden/test_old_message_1 +++ b/test-data/golden/test_old_message_1 @@ -1,4 +1,4 @@ -Single#Chat#10: Bob [PGP bob@example.net] +Direct#Chat#10: Bob [PGP bob@example.net] -------------------------------------------------------------------------------- Msg#10: info (Contact#Contact#Info): Messages are guaranteed to be end-to-end encrypted from now on. [NOTICED][INFO 🛡️] Msg#11: info (Contact#Contact#Info): Bob sent a message from another device. [NOTICED][INFO 🛡️❌] diff --git a/test-data/golden/test_old_message_2 b/test-data/golden/test_old_message_2 index 842ddc8b2..db5ddb064 100644 --- a/test-data/golden/test_old_message_2 +++ b/test-data/golden/test_old_message_2 @@ -1,4 +1,4 @@ -Single#Chat#10: Bob [PGP bob@example.net] +Direct#Chat#10: Bob [PGP bob@example.net] -------------------------------------------------------------------------------- Msg#10: info (Contact#Contact#Info): Messages are guaranteed to be end-to-end encrypted from now on. [NOTICED][INFO 🛡️] Msg#11: info (Contact#Contact#Info): Bob sent a message from another device. [NOTICED][INFO 🛡️❌] diff --git a/test-data/golden/test_old_message_3 b/test-data/golden/test_old_message_3 index 858c3e525..e6a10a485 100644 --- a/test-data/golden/test_old_message_3 +++ b/test-data/golden/test_old_message_3 @@ -1,4 +1,4 @@ -Single#Chat#10: Bob [PGP bob@example.net] 🛡️ +Direct#Chat#10: Bob [PGP bob@example.net] 🛡️ -------------------------------------------------------------------------------- Msg#10: info (Contact#Contact#Info): Messages are guaranteed to be end-to-end encrypted from now on. [NOTICED][INFO 🛡️] Msg#11🔒: (Contact#Contact#10): Heyho from my verified device! [FRESH] diff --git a/test-data/golden/test_outgoing_encrypted_msg b/test-data/golden/test_outgoing_encrypted_msg index 4b26297c2..45d2d9652 100644 --- a/test-data/golden/test_outgoing_encrypted_msg +++ b/test-data/golden/test_outgoing_encrypted_msg @@ -1,4 +1,4 @@ -Single#Chat#1001: bob@example.net [KEY bob@example.net] +Direct#Chat#1001: bob@example.net [KEY bob@example.net] -------------------------------------------------------------------------------- Msg#1001: info (Contact#Contact#Info): Messages are end-to-end encrypted. [NOTICED][INFO] Msg#1002🔒: Me (Contact#Contact#Self): Test – This is encrypted, signed, and has an Autocrypt Header without prefer-encrypt=mutual. √ diff --git a/test-data/golden/test_outgoing_mua_msg b/test-data/golden/test_outgoing_mua_msg index 5940262b1..8146767ac 100644 --- a/test-data/golden/test_outgoing_mua_msg +++ b/test-data/golden/test_outgoing_mua_msg @@ -1,4 +1,4 @@ -Single#Chat#1002: bob@example.net [bob@example.net] Icon: 4138c52e5bc1c576cda7dd44d088c07.png +Direct#Chat#1002: bob@example.net [bob@example.net] Icon: 4138c52e5bc1c576cda7dd44d088c07.png -------------------------------------------------------------------------------- Msg#1003: Me (Contact#Contact#Self): One classical MUA message √ -------------------------------------------------------------------------------- diff --git a/test-data/golden/test_outgoing_mua_msg_pgp b/test-data/golden/test_outgoing_mua_msg_pgp index 3c4c163f4..02110580c 100644 --- a/test-data/golden/test_outgoing_mua_msg_pgp +++ b/test-data/golden/test_outgoing_mua_msg_pgp @@ -1,4 +1,4 @@ -Single#Chat#1001: bob@example.net [KEY bob@example.net] +Direct#Chat#1001: bob@example.net [KEY bob@example.net] -------------------------------------------------------------------------------- Msg#1001: info (Contact#Contact#Info): Messages are end-to-end encrypted. [NOTICED][INFO] Msg#1002🔒: (Contact#Contact#1001): Heyho from DC [FRESH] diff --git a/test-data/golden/test_verified_oneonone_chat_enable_disable b/test-data/golden/test_verified_oneonone_chat_enable_disable index df3a1f707..b333f44e6 100644 --- a/test-data/golden/test_verified_oneonone_chat_enable_disable +++ b/test-data/golden/test_verified_oneonone_chat_enable_disable @@ -1,4 +1,4 @@ -Single#Chat#10: Bob [PGP bob@example.net] 🛡️ +Direct#Chat#10: Bob [PGP bob@example.net] 🛡️ -------------------------------------------------------------------------------- Msg#10: info (Contact#Contact#Info): Messages are guaranteed to be end-to-end encrypted from now on. [NOTICED][INFO 🛡️] Msg#11: info (Contact#Contact#Info): Bob sent a message from another device. [NOTICED][INFO 🛡️❌]