diff options
author | Wolfgang Müller | 2021-04-27 18:34:51 +0200 |
---|---|---|
committer | Wolfgang Müller | 2021-04-28 20:15:53 +0200 |
commit | 2c4f2670d0e7c6f8d93b1a9db9a59156d1024aab (patch) | |
tree | e30197b5462dbbb93e8d6ce2d97fb7e72ed417a3 | |
parent | 1801fe5c5a5d42cb30de0803377ed4e682fcea3c (diff) | |
download | quarg-2c4f2670d0e7c6f8d93b1a9db9a59156d1024aab.tar.gz |
formatter: Make parameter name for format_netsplit clearer
-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, } |