diff --git a/irclog.py b/irclog.py index c6320b4..c5d0efe 100644 --- a/irclog.py +++ b/irclog.py @@ -934,7 +934,17 @@ class WebServer: d = datetime.datetime.utcfromtimestamp(ts).replace(tzinfo = datetime.timezone.utc) date = f'{d:%Y-%m-%d }' if withDate else '' lineId = hashlib.md5(f'{ts} {command} {content}'.encode('utf-8')).hexdigest()[:8] - ret.append(f'{date}{d:%H:%M:%S}{html.escape(content)}') + if command in ('NOTICE', 'PRIVMSG'): + author, content = content.split(' ', 1) + else: + author = '' + ret.append(''.join([ + f'', + f'{date}{d:%H:%M:%S}', + f'{html.escape(author)}', + f'{html.escape(content)}', + '' + ])) return '\n' + '\n'.join(ret) + '\n
' if ret else '' async def get_log(self, request):