mirror of
https://github.com/chatmail/core.git
synced 2026-04-27 10:26:29 +03:00
api!: Contact::get_color(): Preserve address-based color hue for SELF
4010c60e7b "feat: use key fingerprints for color generation" changes
colors for contacts including SELF. Even if an avatar is set, the self-color is visible in
e.g. replies to outgoing messages.
This adds `Config::Selfcolor` and sets it in a migration. This doesn't preserve the old
address-based color accurately because the old code generating colors is already dropped, so this
only preserves the color angle (hue).
This commit is contained in:
@@ -136,6 +136,9 @@ pub enum Config {
|
||||
/// Own name to use in the `From:` field when sending messages.
|
||||
Displayname,
|
||||
|
||||
/// Own color to use in the avatar placeholder and replies to outgoing messages.
|
||||
Selfcolor,
|
||||
|
||||
/// Own status to display, sent in message footer.
|
||||
Selfstatus,
|
||||
|
||||
@@ -474,6 +477,7 @@ impl Config {
|
||||
| Self::MvboxMove
|
||||
| Self::ShowEmails
|
||||
| Self::Selfavatar
|
||||
| Self::Selfcolor
|
||||
| Self::Selfstatus,
|
||||
)
|
||||
}
|
||||
@@ -833,7 +837,7 @@ impl Context {
|
||||
}
|
||||
if matches!(
|
||||
key,
|
||||
Config::Displayname | Config::Selfavatar | Config::PrivateTag
|
||||
Config::Displayname | Config::Selfavatar | Config::Selfcolor | Config::PrivateTag
|
||||
) {
|
||||
self.emit_event(EventType::AccountsItemChanged);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user