aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorWolfgang Müller2021-04-27 18:34:51 +0200
committerWolfgang Müller2021-04-28 20:15:53 +0200
commit2c4f2670d0e7c6f8d93b1a9db9a59156d1024aab (patch)
treee30197b5462dbbb93e8d6ce2d97fb7e72ed417a3
parent1801fe5c5a5d42cb30de0803377ed4e682fcea3c (diff)
downloadquarg-2c4f2670d0e7c6f8d93b1a9db9a59156d1024aab.tar.gz
formatter: Make parameter name for format_netsplit clearer
-rw-r--r--quarg/quassel/formatter.py12
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,
}