feat: chat::rename_ex: Don't send sync message if usual message is sent

It's not necessary and in other places like add_contact_to_chat_ex() sync messages are also sent
only if there are no system messages sent like MemberAddedToGroup.
This commit is contained in:
iequidoo
2023-11-24 19:11:37 -03:00
committed by iequidoo
parent 2f2b1e18bf
commit 846278b18e

View File

@@ -3682,7 +3682,7 @@ pub async fn set_chat_name(context: &Context, chat_id: ChatId, new_name: &str) -
async fn rename_ex(
context: &Context,
sync: sync::Sync,
mut sync: sync::Sync,
chat_id: ChatId,
new_name: &str,
) -> Result<()> {
@@ -3728,6 +3728,7 @@ async fn rename_ex(
}
msg.id = send_msg(context, chat_id, &mut msg).await?;
context.emit_msgs_changed(chat_id, msg.id);
sync = Nosync;
}
context.emit_event(EventType::ChatModified(chat_id));
success = true;