From 846278b18ea8234da9358f2dc485782e396df124 Mon Sep 17 00:00:00 2001 From: iequidoo Date: Fri, 24 Nov 2023 19:11:37 -0300 Subject: [PATCH] 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. --- src/chat.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chat.rs b/src/chat.rs index 323a6d44b..91549e76c 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -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;