mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 19:06:35 +03:00
fix places where string-cmp was used instead of addr_cmp() for email-address-comparison
This commit is contained in:
committed by
Floris Bruynooghe
parent
81d069209c
commit
4e6d0c9c69
@@ -1488,7 +1488,7 @@ pub(crate) fn add_contact_to_chat_ex(
|
|||||||
let self_addr = context
|
let self_addr = context
|
||||||
.get_config(Config::ConfiguredAddr)
|
.get_config(Config::ConfiguredAddr)
|
||||||
.unwrap_or_default();
|
.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.
|
// 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.
|
// if SELF is not in the group, members cannot be added at all.
|
||||||
warn!(
|
warn!(
|
||||||
|
|||||||
@@ -272,7 +272,7 @@ impl Contact {
|
|||||||
.get_config(Config::ConfiguredAddr)
|
.get_config(Config::ConfiguredAddr)
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
|
||||||
if addr_normalized == addr_self {
|
if addr_cmp(addr_normalized, addr_self) {
|
||||||
return DC_CONTACT_ID_SELF;
|
return DC_CONTACT_ID_SELF;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -309,7 +309,7 @@ impl Contact {
|
|||||||
.get_config(Config::ConfiguredAddr)
|
.get_config(Config::ConfiguredAddr)
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
|
||||||
if addr == addr_self {
|
if addr_cmp(addr, addr_self) {
|
||||||
return Ok((DC_CONTACT_ID_SELF, sth_modified));
|
return Ok((DC_CONTACT_ID_SELF, sth_modified));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -707,7 +707,7 @@ impl<'a> MimeFactory<'a> {
|
|||||||
.get_config(Config::ConfiguredAddr)
|
.get_config(Config::ConfiguredAddr)
|
||||||
.unwrap_or_default();
|
.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) {
|
if !vec_contains_lowercase(&factory.recipients_addr, &email_to_remove) {
|
||||||
factory.recipients_names.push("".to_string());
|
factory.recipients_names.push("".to_string());
|
||||||
factory.recipients_addr.push(email_to_remove.to_string());
|
factory.recipients_addr.push(email_to_remove.to_string());
|
||||||
|
|||||||
Reference in New Issue
Block a user