Browse Source

Handle CTCP ACTION (aka /me)

To convert log files written with the previous version: `sed -i.bak 's, PRIVMSG <\([^>]\+\)> \x01ACTION \(.*\)\x01$, ACTION \1 \2,' FILES`
master
JustAnotherArchivist 3 years ago
parent
commit
e206a0b77b
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      irclog.py

+ 4
- 0
irclog.py View File

@@ -565,6 +565,10 @@ class IRCClientProtocol(asyncio.Protocol):
channel = line.params[0]
if channel not in self.server.channels:
return
if line.command == 'PRIVMSG' and line.params[1].startswith('\x01ACTION ') and line.params[1].endswith('\x01'):
# CTCP ACTION (aka /me)
yield 'ACTION', channel, f'{get_mode_nick(channel)} {line.params[1][8:-1]}'
return
yield line.command, channel, f'<{get_mode_nick(channel)}> {line.params[1]}'
elif line.command == 'PART':
channels = [line.params[0]] if ',' not in line.params[0] else line.params[0].split(',')


Loading…
Cancel
Save