mirror of
https://github.com/chatmail/core.git
synced 2026-05-09 01:46:30 +03:00
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:
@@ -3692,7 +3692,6 @@ async fn rename_ex(
|
|||||||
chat_id: ChatId,
|
chat_id: ChatId,
|
||||||
new_name: &str,
|
new_name: &str,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
let sync_name = new_name;
|
|
||||||
let new_name = improve_single_line_input(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 */
|
/* the function only sets the names of group chats; normal chats get their names from the contacts */
|
||||||
let mut success = false;
|
let mut success = false;
|
||||||
@@ -3745,7 +3744,7 @@ async fn rename_ex(
|
|||||||
bail!("Failed to set name");
|
bail!("Failed to set name");
|
||||||
}
|
}
|
||||||
if sync.into() && chat.name != new_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))
|
chat.sync(context, SyncAction::Rename(sync_name))
|
||||||
.await
|
.await
|
||||||
.log_err(context)
|
.log_err(context)
|
||||||
|
|||||||
Reference in New Issue
Block a user