From e2d631097d0480e28a89bbae1675727c03afdd8e Mon Sep 17 00:00:00 2001 From: Floris Bruynooghe Date: Thu, 17 Mar 2022 19:29:18 +0100 Subject: [PATCH] Fix master by reverting ContactId Display impl (#3134) Actual fix needs more investigation, it's not obvious. --- src/contact.rs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/contact.rs b/src/contact.rs index e094972c9..98ea82b85 100644 --- a/src/contact.rs +++ b/src/contact.rs @@ -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) + // } } }