Browse Source

Remove channel name from message strings

There's no need for this redundancy, and it makes some file post-processing easier in case it's needed in the future.
master
JustAnotherArchivist 3 years ago
parent
commit
1dd47c4fcb
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      irclog.py

+ 6
- 6
irclog.py View File

@@ -562,7 +562,7 @@ class IRCClientProtocol(asyncio.Protocol):
account = f' ({line.params[-2]})' if 'extended-join' in self.caps and line.params[-2] != '*' else ''
for channel in channels:
# There can't be a mode set yet on the JOIN, so no need to use get_mode_nick (which would complicate the self-join).
yield 'JOIN', channel, f'{line.hostmask.nickname}{account} joins {channel}'
yield 'JOIN', channel, f'{line.hostmask.nickname}{account} joins'
elif line.command in ('PRIVMSG', 'NOTICE'):
channel = line.params[0]
if channel not in self.server.channels:
@@ -576,7 +576,7 @@ class IRCClientProtocol(asyncio.Protocol):
channels = [line.params[0]] if ',' not in line.params[0] else line.params[0].split(',')
reason = f' [{line.params[1]}]' if len(line.params) == 2 else ''
for channel in channels:
yield 'PART', channel, f'{get_mode_nick(channel)} leaves {channel}'
yield 'PART', channel, f'{get_mode_nick(channel)} leaves'
elif line.command in ('QUIT', 'NICK', 'ACCOUNT'):
if line.hostmask.nickname == self.server.nickname:
channels = self.channels
@@ -599,13 +599,13 @@ class IRCClientProtocol(asyncio.Protocol):
elif line.command == 'KICK':
channel = line.params[0]
reason = f' [{line.params[2]}]' if len(line.params) == 3 else ''
yield 'KICK', channel, f'{get_mode_nick(channel, line.params[1])} is kicked from {channel} by {get_mode_nick(channel)}{reason}'
yield 'KICK', channel, f'{get_mode_nick(channel, line.params[1])} is kicked by {get_mode_nick(channel)}{reason}'
elif line.command == 'TOPIC':
channel = line.params[0]
if line.params[1] == '':
yield 'TOPIC', channel, f'{get_mode_nick(channel)} unsets the topic of {channel}'
yield 'TOPIC', channel, f'{get_mode_nick(channel)} unsets the topic'
else:
yield 'TOPIC', channel, f'{get_mode_nick(channel)} sets the topic of {channel} to: {line.params[1]}'
yield 'TOPIC', channel, f'{get_mode_nick(channel)} sets the topic to: {line.params[1]}'
elif line.command == ircstates.numerics.RPL_TOPIC:
channel = line.params[1]
yield 'TOPIC', channel, f'Topic of {channel}: {line.params[2]}'
@@ -615,7 +615,7 @@ class IRCClientProtocol(asyncio.Protocol):
elif line.command == ircstates.numerics.RPL_ENDOFNAMES:
channel = line.params[1]
users = self.server.channels[self.server.casefold(channel)].users
yield 'NAMES', channel, f'Currently in {channel}: {", ".join(self.render_nick_with_mode(u, u.nickname) for u in users.values())}'
yield 'NAMES', channel, f'Current users: {", ".join(self.render_nick_with_mode(u, u.nickname) for u in users.values())}'

def render_whox(self):
users = []


Loading…
Cancel
Save