From 958802a233071e444ad994bdef6031a38941d055 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Tue, 31 Mar 2020 00:41:07 +0300 Subject: [PATCH] Add system message only if contact was removed successfully --- src/chat.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/chat.rs b/src/chat.rs index f0f3d0e6d..11c391097 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -2063,7 +2063,7 @@ pub fn remove_contact_from_chat( "Cannot remove contact from chat; self not in group.".into() ) ); - } else { + } else if remove_from_chat_contacts_table(context, chat_id, contact_id) { /* we should respect this - whatever we send to the group, it gets discarded anyway! */ if let Ok(contact) = Contact::get_by_id(context, contact_id) { if chat.is_promoted() { @@ -2093,10 +2093,9 @@ pub fn remove_contact_from_chat( }); } } - if remove_from_chat_contacts_table(context, chat_id, contact_id) { - context.call_cb(Event::ChatModified(chat_id)); - success = true; - } + + context.call_cb(Event::ChatModified(chat_id)); + success = true; } } }