|
|
@@ -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 = [] |
|
|
|