mirror of
https://github.com/chatmail/core.git
synced 2026-04-20 15:06:30 +03:00
use name+addr also for ByContact::SelfName to not get another class of strings that may look like a bug; add a test for that
This commit is contained in:
@@ -282,18 +282,21 @@ impl Context {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn get_config_self_name(&self) -> String {
|
||||
match self
|
||||
pub async fn get_config_name_and_addr(&self) -> String {
|
||||
let name = self
|
||||
.get_config(Config::Displayname)
|
||||
.await
|
||||
.unwrap_or_default()
|
||||
{
|
||||
Some(name) => name,
|
||||
None => self
|
||||
.get_config(Config::Addr)
|
||||
.await
|
||||
.unwrap_or_default()
|
||||
.unwrap_or_default(),
|
||||
.unwrap_or_default();
|
||||
let addr = self
|
||||
.get_config(Config::Addr)
|
||||
.await
|
||||
.unwrap_or_default()
|
||||
.unwrap_or_else(|| "unconfigured".to_string());
|
||||
if !name.is_empty() {
|
||||
format!("{} ({})", name, addr)
|
||||
} else {
|
||||
addr
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user