fix: chat::rename_ex(): Sync improved chat name to other devices

Other devices should get the same chat name as the currently used device, i.e. the name a user sees
after renaming the chat. This fix is minor because `improve_single_line_input()` logic isn't going
to change often, but still, and also it simplifies the code.
This commit is contained in:
iequidoo
2023-11-15 23:47:17 -03:00
committed by iequidoo
parent 607b9e55a9
commit 1509978738

View File

@@ -3692,7 +3692,6 @@ async fn rename_ex(
chat_id: ChatId,
new_name: &str,
) -> Result<()> {
let sync_name = new_name;
let new_name = improve_single_line_input(new_name);
/* the function only sets the names of group chats; normal chats get their names from the contacts */
let mut success = false;
@@ -3745,7 +3744,7 @@ async fn rename_ex(
bail!("Failed to set name");
}
if sync.into() && chat.name != new_name {
let sync_name = sync_name.to_string();
let sync_name = new_name.to_string();
chat.sync(context, SyncAction::Rename(sync_name))
.await
.log_err(context)