diff options
-rw-r--r-- | quarg/quassel/formatter.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/quarg/quassel/formatter.py b/quarg/quassel/formatter.py index ed33719..9c89970 100644 --- a/quarg/quassel/formatter.py +++ b/quarg/quassel/formatter.py @@ -84,12 +84,12 @@ def parse_netsplit(splitmsg): return users, servers, rest -def format_netsplit(quit, msg): +def format_netsplit(has_ended, msg): users, (srv_left, srv_right), rest = parse_netsplit(msg.message) affected = ', '.join(user.nick for user in users) + (f' ({rest} more)' if rest else '') - if quit: - return f'<= Netsplit between {srv_left} and {srv_right}. Users quit: {affected}' - return f'=> Netsplit between {srv_left} and {srv_right} ended. Users joined: {affected}' + if has_ended: + return f'=> Netsplit between {srv_left} and {srv_right} ended. Users joined: {affected}' + return f'<= Netsplit between {srv_left} and {srv_right}. Users quit: {affected}' def fmt(string): @@ -111,7 +111,7 @@ FORMATTERS = { MessageType.ERROR: format_generic, MessageType.DAYCHANGE: format_generic, MessageType.TOPIC: format_generic, - MessageType.NETSPLIT_JOIN: partial(format_netsplit, False), - MessageType.NETSPLIT_QUIT: partial(format_netsplit, True), + MessageType.NETSPLIT_JOIN: partial(format_netsplit, True), + MessageType.NETSPLIT_QUIT: partial(format_netsplit, False), MessageType.INVITE: format_generic, } |