Fix master by reverting ContactId Display impl (#3134)

Actual fix needs more investigation, it's not obvious.
This commit is contained in:
Floris Bruynooghe
2022-03-17 19:29:18 +01:00
committed by GitHub
parent cc55be0b0a
commit e2d631097d

View File

@@ -15,9 +15,8 @@ use crate::chat::ChatId;
use crate::color::str_to_color;
use crate::config::Config;
use crate::constants::{
Blocked, Chattype, DC_CONTACT_ID_DEVICE, DC_CONTACT_ID_DEVICE_ADDR, DC_CONTACT_ID_INFO,
DC_CONTACT_ID_LAST_SPECIAL, DC_CONTACT_ID_SELF, DC_CONTACT_ID_UNDEFINED, DC_GCL_ADD_SELF,
DC_GCL_VERIFIED_ONLY,
Blocked, Chattype, DC_CONTACT_ID_DEVICE, DC_CONTACT_ID_DEVICE_ADDR, DC_CONTACT_ID_LAST_SPECIAL,
DC_CONTACT_ID_SELF, DC_GCL_ADD_SELF, DC_GCL_VERIFIED_ONLY,
};
use crate::context::Context;
use crate::dc_tools::{dc_get_abs_path, improve_single_line_input, EmailAddress};
@@ -53,19 +52,20 @@ impl ContactId {
impl fmt::Display for ContactId {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
if *self == DC_CONTACT_ID_UNDEFINED {
write!(f, "Contact#Undefined")
} else if *self == DC_CONTACT_ID_SELF {
write!(f, "Contact#Self")
} else if *self == DC_CONTACT_ID_INFO {
write!(f, "Contact#Info")
} else if *self == DC_CONTACT_ID_DEVICE {
write!(f, "Contact#Device")
} else if *self <= DC_CONTACT_ID_LAST_SPECIAL {
write!(f, "Contact#Special{}", self.0)
} else {
write!(f, "Contact#{}", self.0)
}
write!(f, "{}", self.0)
// if *self == DC_CONTACT_ID_UNDEFINED {
// write!(f, "Contact#Undefined")
// } else if *self == DC_CONTACT_ID_SELF {
// write!(f, "Contact#Self")
// } else if *self == DC_CONTACT_ID_INFO {
// write!(f, "Contact#Info")
// } else if *self == DC_CONTACT_ID_DEVICE {
// write!(f, "Contact#Device")
// } else if *self <= DC_CONTACT_ID_LAST_SPECIAL {
// write!(f, "Contact#Special{}", self.0)
// } else {
// write!(f, "Contact#{}", self.0)
// }
}
}