From 4e6d0c9c6935193a0425527f1e0b361a3d42e557 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Thu, 28 Nov 2019 17:29:00 +0100 Subject: [PATCH] fix places where string-cmp was used instead of addr_cmp() for email-address-comparison --- src/chat.rs | 2 +- src/contact.rs | 4 ++-- src/mimefactory.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chat.rs b/src/chat.rs index 1da821d93..30b10dcff 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -1488,7 +1488,7 @@ pub(crate) fn add_contact_to_chat_ex( let self_addr = context .get_config(Config::ConfiguredAddr) .unwrap_or_default(); - if contact.get_addr() == &self_addr { + if addr_cmp(contact.get_addr(), &self_addr) { // ourself is added using DC_CONTACT_ID_SELF, do not add this address explicitly. // if SELF is not in the group, members cannot be added at all. warn!( diff --git a/src/contact.rs b/src/contact.rs index 2d7438b71..17c592ad2 100644 --- a/src/contact.rs +++ b/src/contact.rs @@ -272,7 +272,7 @@ impl Contact { .get_config(Config::ConfiguredAddr) .unwrap_or_default(); - if addr_normalized == addr_self { + if addr_cmp(addr_normalized, addr_self) { return DC_CONTACT_ID_SELF; } @@ -309,7 +309,7 @@ impl Contact { .get_config(Config::ConfiguredAddr) .unwrap_or_default(); - if addr == addr_self { + if addr_cmp(addr, addr_self) { return Ok((DC_CONTACT_ID_SELF, sth_modified)); } diff --git a/src/mimefactory.rs b/src/mimefactory.rs index c80dc67f9..cf56c42f8 100644 --- a/src/mimefactory.rs +++ b/src/mimefactory.rs @@ -707,7 +707,7 @@ impl<'a> MimeFactory<'a> { .get_config(Config::ConfiguredAddr) .unwrap_or_default(); - if !email_to_remove.is_empty() && email_to_remove != self_addr { + if !email_to_remove.is_empty() && !addr_cmp(email_to_remove, self_addr) { if !vec_contains_lowercase(&factory.recipients_addr, &email_to_remove) { factory.recipients_names.push("".to_string()); factory.recipients_addr.push(email_to_remove.to_string());