From 48547972e9994250c53ec8563f963b7203df6bf9 Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Thu, 31 Dec 2015 15:06:19 -0700 Subject: [PATCH] Make is_user_stasised return a truthy value if the user is not found This ensures that code paths that should not be run if the user is stasised are not run if we don't know the user's status. Generally we don't know the user's status because they are not in the main channel, and therefore allowing them to effectively bypass stasis by not being around is a bad thing. We return -1 to differentiate between actual stasis, and because -1 is still True when cast to boolean. This may have the effect of giving some very odd-looking error messages but that's a very minor issue. --- src/wolfgame.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wolfgame.py b/src/wolfgame.py index 9637713..3fc5ba7 100644 --- a/src/wolfgame.py +++ b/src/wolfgame.py @@ -7797,7 +7797,7 @@ def is_user_stasised(nick): host = var.USERS[nick]["host"] acc = var.USERS[nick]["account"] else: - return 0 + return -1 amount = 0 if not var.DISABLE_ACCOUNTS and acc and acc != "*": if acc in var.STASISED_ACCS: