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:
iequidoo
2025-08-27 07:20:52 -03:00
parent 0bbd910883
commit 0dab21007d
13 changed files with 66 additions and 15 deletions

View File

@@ -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);
}