diff --git a/nomadnet/NomadNetworkApp.py b/nomadnet/NomadNetworkApp.py index 428af97..522a77c 100644 --- a/nomadnet/NomadNetworkApp.py +++ b/nomadnet/NomadNetworkApp.py @@ -158,6 +158,7 @@ class NomadNetworkApp: self.rrc_ephemeral_notices = 600 self.rrc_nick_colors = True self.rrc_nick_colors_theme = None + self.rrc_mention_color = None self.rrc_color_mention_timestamps = True self.rrc_ui_justify_msgs = True self.rrc_ui_space_msgs = False @@ -1013,6 +1014,13 @@ class NomadNetworkApp: except Exception: value = True self.rrc_nick_colors = value + if option == "mention_color": + value = self.config["rrc"][option] + if len(value) == 6: + try: bytes.fromhex(value) + except Exception: value = None + self.rrc_mention_color = value + if option == "color_mention_timestamps": try: value = self.config["rrc"].as_bool(option) except Exception: value = True @@ -1409,6 +1417,10 @@ show_gutters = yes # for nick color assignment # nick_colors_theme = f68787, 00c394, d59e00, ... +# You can set a specific color for mentions +# of your nick +# mention_color = FFBB44 + [node] diff --git a/nomadnet/ui/textui/Channels.py b/nomadnet/ui/textui/Channels.py index 63b05a1..6a02747 100644 --- a/nomadnet/ui/textui/Channels.py +++ b/nomadnet/ui/textui/Channels.py @@ -1314,12 +1314,15 @@ def _message_widget(app, hub, room, m, link_delegate=None): mb = span[1] if ms.startswith("irc_mention"): if not app.rrc_nick_colors: - message_body += f"`!`F{t['mention']}{mb}`f`!" + if app.rrc_mention_color: mention_color = f"`FT{app.rrc_mention_color}" + else: mention_color = f"`F{t['mention']}" + message_body += f"`!{mention_color}{mb}`f`!" if app.rrc_color_mention_timestamps: irc_ts = f"`F{t['mention']}" else: try: - own_nick_color = get_nick_color(app.identity.hash, t, app) + if not app.rrc_mention_color: own_nick_color = get_nick_color(app.identity.hash, t, app) + else: own_nick_color = app.rrc_mention_color message_body += f"`!`FT{own_nick_color}{mb}`f`!" if app.rrc_color_mention_timestamps: irc_ts = f"`FT{own_nick_color}" diff --git a/nomadnet/ui/textui/Guide.py b/nomadnet/ui/textui/Guide.py index 4790f0e..6f58f94 100644 --- a/nomadnet/ui/textui/Guide.py +++ b/nomadnet/ui/textui/Guide.py @@ -1000,6 +1000,12 @@ Whether or not to render micron formatting in messages. When using micron in mes Whether or not to render RRC nicks in distinct colors based on identity hash. < +>>> +`!mention_color = None`! +>>>> +Sets a specific color for mentions of your nick, for example FFBB44. +< + >>> `!color_mention_timestamps = yes`! >>>>