mirror of
https://github.com/chatmail/core.git
synced 2026-05-13 11:56:30 +03:00
fix: use different member added/removal messages locally and on the network
This commit adds new stock strings "I added member ...", "I removed member ..." and "I left the group" that are sent over the network and are visible in classic MUAs like Thunderbird. Member name in these messages uses authname instead of the display name, so the name set locally does not get leaked when a member is added or removed.
This commit is contained in:
@@ -1141,11 +1141,29 @@ impl Contact {
|
||||
&self.addr
|
||||
}
|
||||
|
||||
/// Get a summary of authorized name and address.
|
||||
///
|
||||
/// The returned string is either "Name (email@domain.com)" or just
|
||||
/// "email@domain.com" if the name is unset.
|
||||
///
|
||||
/// This string is suitable for sending over email
|
||||
/// as it does not leak the locally set name.
|
||||
pub fn get_authname_n_addr(&self) -> String {
|
||||
if !self.authname.is_empty() {
|
||||
format!("{} ({})", self.authname, self.addr)
|
||||
} else {
|
||||
(&self.addr).into()
|
||||
}
|
||||
}
|
||||
|
||||
/// Get a summary of name and address.
|
||||
///
|
||||
/// The returned string is either "Name (email@domain.com)" or just
|
||||
/// "email@domain.com" if the name is unset.
|
||||
///
|
||||
/// The result should only be used locally and never sent over the network
|
||||
/// as it leaks the local contact name.
|
||||
///
|
||||
/// The summary is typically used when asking the user something about the contact.
|
||||
/// The attached email address makes the question unique, eg. "Chat with Alan Miller (am@uniquedomain.com)?"
|
||||
pub fn get_name_n_addr(&self) -> String {
|
||||
|
||||
Reference in New Issue
Block a user