Only allow retracting start votes in the main channel

This commit is contained in:
Lukas Martini 2015-12-04 04:22:18 +01:00
parent 548d212435
commit b8b61a0c8d

View File

@ -5140,15 +5140,16 @@ def retract(cli, nick, chan, rest):
with var.GRAVEYARD_LOCK, var.WARNING_LOCK: with var.GRAVEYARD_LOCK, var.WARNING_LOCK:
if var.PHASE == "join": if var.PHASE == "join":
if not nick in var.START_VOTES: if chan == botconfig.CHANNEL:
cli.notice(nick, messages["start_novote"]) if not nick in var.START_VOTES:
else: cli.notice(nick, messages["start_novote"])
var.START_VOTES.discard(nick) else:
cli.msg(chan, messages["start_retract"].format(nick)) var.START_VOTES.discard(nick)
cli.msg(chan, messages["start_retract"].format(nick))
if len(var.START_VOTES) < 1: if len(var.START_VOTES) < 1:
var.TIMERS['start_votes'][0].cancel() var.TIMERS['start_votes'][0].cancel()
del var.TIMERS['start_votes'] del var.TIMERS['start_votes']
return return
if chan == nick: # PM, use different code if chan == nick: # PM, use different code