X-Git-Url: https://plomlompom.com/repos/?p=plomlombot-irc.git;a=blobdiff_plain;f=irclog.py;h=6455daec874fb9300643a2eddc8dde83d1b75692;hp=a62acadef4a4a2490a47e2b5ae9098523902d95f;hb=822065cbe31e5fb79c018c444b0009999b2b325c;hpb=cab26fc280cebb5c648fe09a6d2f2f3796ea3a81 diff --git a/irclog.py b/irclog.py index a62acad..6455dae 100644 --- a/irclog.py +++ b/irclog.py @@ -1,10 +1,11 @@ #!/usr/bin/python3 -def format_logline(line, channel): +def format_logline(line, channel, identity): if len(line.tokens) > 2: if line.tokens[1] == "JOIN": - return "-> " + line.sender + " (" + \ - line.tokens[0][len(line.sender)+2:] + ") joins" + if identity == "": + identity = line.tokens[0][len(line.sender) + 2:] + return "-> " + line.sender + " (" + identity + ") joins" elif line.tokens[1] == "PART": msg = "" if len(line.tokens) > 3 and line.tokens[3][0] == ":": @@ -14,7 +15,7 @@ def format_logline(line, channel): msg = "" if len(line.tokens) > 2 and line.tokens[2][0] == ":": msg = " (" + str.join(" ", line.tokens[2:])[1:] + ")" - return "<- " + line.sender + " quits server" + msg + return "<- " + line.sender + " quits server" + msg elif line.tokens[1] == "NICK": return "-- " + line.sender + " changes their name to " + line.receiver elif len(line.tokens) > 3: