Changelog: Added option to set specific mention color

This commit is contained in:
Mark Qvist
2026-05-22 23:10:33 +02:00
parent 814cd043b8
commit 859aaeeba9
3 changed files with 23 additions and 2 deletions
+12
View File
@@ -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]
+5 -2
View File
@@ -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}"
+6
View File
@@ -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`!
>>>>