Changelog: Added option to color mention timestamps

This commit is contained in:
Mark Qvist 2026-05-22 22:33:15 +02:00
parent 7fe7a54db1
commit 69f17fe3c4
3 changed files with 24 additions and 4 deletions

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_color_mention_timestamps = True
self.rrc_ui_justify_msgs = True
self.rrc_ui_space_msgs = False
self.rrc_ui_render_markdown = True
@ -1011,6 +1012,11 @@ class NomadNetworkApp:
except Exception: value = True
self.rrc_nick_colors = value
if option == "color_mention_timestamps":
try: value = self.config["rrc"].as_bool(option)
except Exception: value = True
self.rrc_color_mention_timestamps = value
if option == "nick_colors_theme":
try:
colors = self.config["rrc"].as_list(option)
@ -1385,6 +1391,7 @@ filter_loaded_history = yes
ephemeral_notices = 10
# Other display and formatting options:
color_mention_timestamps = yes
render_markdown = yes
render_micron = yes
nick_colors = yes

View file

@ -1307,14 +1307,22 @@ def _message_widget(app, hub, room, m, link_delegate=None):
spans, has_links = _body_markup(body, body_attr="body_text", own_nick=own_nick, check_links=False)
ld = link_delegate if has_links else None
irc_ts = f"`F{t['ts']}"
message_body = ""
for span in spans:
ms = span[0]
mb = span[1]
if ms.startswith("irc_mention"):
if not app.rrc_nick_colors: message_body += f"`!`F{t['mention']}{mb}`f`!"
if not app.rrc_nick_colors:
message_body += f"`!`F{t['mention']}{mb}`f`!"
if app.rrc_color_mention_timestamps: irc_ts = f"`F{t['mention']}"
else:
try: message_body += f"`!`FT{get_nick_color(app.identity.hash, t, app)}{mb}`f`!"
try:
own_nick_color = get_nick_color(app.identity.hash, t, app)
message_body += f"`!`FT{own_nick_color}{mb}`f`!"
if app.rrc_color_mention_timestamps: irc_ts = f"`FT{own_nick_color}"
except: message_body += f"`!`F{t['mention']}{mb}`f`!"
elif ms.startswith("nick_mention"):
@ -1360,9 +1368,8 @@ def _message_widget(app, hub, room, m, link_delegate=None):
if app.rrc_nick_colors: nick_attr = f"`FT{get_nick_color(m.src, t, app)}"
else: nick_attr = f"`F{t['nick_self']}" if own else f"`F{t['nick_peer']}"
irc_ts = f"`F{t['ts']}"
prefix_micron = f"{irc_ts}{_ts_prefix_raw(m.ts)}"
prefix_micron = f"{irc_ts}{_ts_prefix_raw(m.ts)}`f"
if m.kind == "action":
nick_micron = f" `*`f{nick_attr}{sender}`f`* "
message_body = f"`*`f{nick_attr}{strip_micron(message_body)}`f`*"

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.
<
>>>
`!color_mention_timestamps = yes`!
>>>>
Whether or not to color timestamps of messages you were mentioned in.
<
>>>
`!justify_msgs = yes`!
`!space_msgs = no`!