Browse Source

Fix wrong offset on a type of QUITs

master
JustAnotherArchivist 3 years ago
parent
commit
2786e583c4
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      efnet-irclogger-convert.py

+ 1
- 1
efnet-irclogger-convert.py View File

@@ -68,7 +68,7 @@ with open(filename, 'rb') as fp:
sys.stdout.buffer.write(f'{ts} QUIT '.encode('ascii') + words[0] + b' quits' + reason + b'\n') sys.stdout.buffer.write(f'{ts} QUIT '.encode('ascii') + words[0] + b' quits' + reason + b'\n')
elif words[0] == b'Quits:' and words[3][0:1] == b'(' and words[-1][-1:] == b')': elif words[0] == b'Quits:' and words[3][0:1] == b'(' and words[-1][-1:] == b')':
reason = (b' [' + b' '.join(words[3:])[1:-1] + b']') if len(words) > 4 or words[3] != b'()' else b'' reason = (b' [' + b' '.join(words[3:])[1:-1] + b']') if len(words) > 4 or words[3] != b'()' else b''
sys.stdout.buffer.write(f'{ts} QUIT '.encode('ascii') + words[0] + b' quits' + reason + b'\n')
sys.stdout.buffer.write(f'{ts} QUIT '.encode('ascii') + words[1] + b' quits' + reason + b'\n')
# KICK # KICK
elif words[1:4] == [b'was', b'kicked', b'by'] and words[5][0:1] == b'(' and words[-1][-1:] == b')': elif words[1:4] == [b'was', b'kicked', b'by'] and words[5][0:1] == b'(' and words[-1][-1:] == b')':
sys.stdout.buffer.write(f'{ts} KICK '.encode('ascii') + words[0] + b' is kicked by ' + words[4] + b' [' + b' '.join(words[5:])[1:-1] + b']' + b'\n') sys.stdout.buffer.write(f'{ts} KICK '.encode('ascii') + words[0] + b' is kicked by ' + words[4] + b' [' + b' '.join(words[5:])[1:-1] + b']' + b'\n')


Loading…
Cancel
Save