The code in troutq and blameq is very clone and hack. This change
reduces it very slightly so that I can make my next change in only one
place.
No functional change.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
fishpond.DoS=0
fishpond.quotatime=0
fishpond.DoS=0
fishpond.quotatime=0
+ def note_last(fishpond, msg, cfg):
+ fishpond.last=msg
+ fishpond.last_cfg=cfg
+
# Check on fish stocks
def fish_quota(pond):
if pond.DoS:
# Check on fish stocks
def fish_quota(pond):
if pond.DoS:
return
me = bot.connection.get_nickname()
trout_msg = random.choice(fishlist)
return
me = bot.connection.get_nickname()
trout_msg = random.choice(fishlist)
- fishpond.last=trout_msg
- fishpond.last_cfg=cfg
+ fishpond.note_last(trout_msg,cfg)
# The bot won't trout or flirt with itself;
if irc_lower(me) == irc_lower(target) or irc_lower(target) in synonyms:
target = nick
# The bot won't trout or flirt with itself;
if irc_lower(me) == irc_lower(target) or irc_lower(target) in synonyms:
target = nick
return
me = bot.connection.get_nickname()
slash_msg = random.choice(fishlist)
return
me = bot.connection.get_nickname()
slash_msg = random.choice(fishlist)
- fishpond.last=slash_msg
- fishpond.last_cfg=cfg
+ fishpond.note_last(slash_msg,cfg)
# The bot won't slash people with themselves
if irc_lower(who[0]) == irc_lower(who[1]):
conn.notice(nick, "oooooh no missus!")
# The bot won't slash people with themselves
if irc_lower(who[0]) == irc_lower(who[1]):
conn.notice(nick, "oooooh no missus!")