Do not ping players with unacked warnings
This fixes issue #255 by preventing unacked warnings from being pinged entirely (whether or not they would cause stasis).
This commit is contained in:
parent
965b230f64
commit
a42da38e8e
@ -13,7 +13,7 @@ __all__ = ["pm", "is_fake_nick", "mass_mode", "mass_privmsg", "reply",
|
||||
"relay_wolfchat_command", "irc_lower", "irc_equals", "match_hostmask",
|
||||
"is_owner", "is_admin", "plural", "singular", "list_players",
|
||||
"get_role", "get_roles", "change_role", "role_order", "break_long_message",
|
||||
"complete_match", "complete_one_match", "get_victim", "get_nick", "InvalidModeException"]
|
||||
"complete_match", "complete_one_match", "get_victim", "InvalidModeException"]
|
||||
# message either privmsg or notice, depending on user settings
|
||||
def pm(cli, target, message):
|
||||
if is_fake_nick(target) and botconfig.DEBUG_MODE:
|
||||
@ -381,15 +381,6 @@ def get_victim(cli, nick, victim, in_chan, self_in_list=False, bot_in_list=False
|
||||
return
|
||||
return pl[pll.index(tempvictims.pop())] #convert back to normal casing
|
||||
|
||||
# wrapper around complete_match() used for any nick on the channel
|
||||
def get_nick(cli, nick):
|
||||
ul = [x for x in var.USERS]
|
||||
ull = [x.lower() for x in var.USERS]
|
||||
lnick = complete_match(nick.lower(), ull)
|
||||
if not lnick:
|
||||
return None
|
||||
return ul[ull.index(lnick)]
|
||||
|
||||
class InvalidModeException(Exception): pass
|
||||
|
||||
# vim: set sw=4 expandtab:
|
||||
|
@ -673,12 +673,16 @@ def join_timer_handler(var):
|
||||
for num in var.PING_IF_NUMS_ACCS:
|
||||
if num <= len(pl):
|
||||
for acc in var.PING_IF_NUMS_ACCS[num]:
|
||||
if db.has_unacknowledged_warnings(acc, None):
|
||||
continue
|
||||
chk_acc.add(users.lower(acc))
|
||||
|
||||
if not var.ACCOUNTS_ONLY:
|
||||
for num in var.PING_IF_NUMS:
|
||||
if num <= len(pl):
|
||||
for hostmask in var.PING_IF_NUMS[num]:
|
||||
if db.has_unacknowledged_warnings(None, hostmask):
|
||||
continue
|
||||
checker.add(users.lower(hostmask, casemapping="ascii"))
|
||||
|
||||
# Don't ping alt connections of users that have already joined
|
||||
|
Loading…
Reference in New Issue
Block a user