From 1c117507c48508e8af2e3f8a23f3ef2dc4c3b4dd Mon Sep 17 00:00:00 2001 From: zenith <157907903+RFnexus@users.noreply.github.com> Date: Thu, 14 May 2026 12:43:48 -0400 Subject: [PATCH] Change AutoWho regex to match partial hashes --- nomadnet/RRC.py | 4 ++-- nomadnet/ui/textui/Channels.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nomadnet/RRC.py b/nomadnet/RRC.py index fa8d088..bc1766c 100644 --- a/nomadnet/RRC.py +++ b/nomadnet/RRC.py @@ -104,7 +104,7 @@ def _msg_id(): # greedy .+ intentionally captures nicks containing parens like "user (alt) (deadbeefcafe)" _WHO_ENTRY_RE = re.compile( r"(?:^|,\s)" - r"(?:(?P.+?)\s\((?P[0-9a-fA-F]+)\)|(?P[0-9a-fA-F]+))" + r"(?:(?P[0-9a-fA-F]{32})|(?P.+?)\s\((?P[0-9a-fA-F]{12})\))" r"(?=,\s|$)" ) @@ -279,7 +279,7 @@ class RRCHub: nick = self.nicks.get(ph) if nick: return nick - return ph.hex()[:10] + return ph.hex()[:12] def mark_read(self, room): r = self._normalize_room(room) diff --git a/nomadnet/ui/textui/Channels.py b/nomadnet/ui/textui/Channels.py index 52342c7..0e62a7c 100644 --- a/nomadnet/ui/textui/Channels.py +++ b/nomadnet/ui/textui/Channels.py @@ -137,7 +137,7 @@ def _body_markup(body, body_attr="body_text", own_nick=None): return out, has_links -def _short_hash(b, n=10): +def _short_hash(b, n=12): if isinstance(b, (bytes, bytearray)): return bytes(b).hex()[:n] return "?"