Fix issue where sometimes the bot didn't recognize someone returning to the village
This commit is contained in:
parent
2f0d299903
commit
e816f4b436
@ -1349,7 +1349,8 @@ def on_kicked(cli, nick, chan, victim, reason):
|
|||||||
@hook("account")
|
@hook("account")
|
||||||
def on_account(cli, rnick, acc):
|
def on_account(cli, rnick, acc):
|
||||||
nick, _, ident, host = parse_nick(rnick)
|
nick, _, ident, host = parse_nick(rnick)
|
||||||
hostmask = ident + "@" + host
|
hostmask = irc_lower(ident) + "@" + host.lower()
|
||||||
|
lacc = irc_lower(acc)
|
||||||
chan = botconfig.CHANNEL
|
chan = botconfig.CHANNEL
|
||||||
if acc == "*" and var.ACCOUNTS_ONLY and nick in list_players():
|
if acc == "*" and var.ACCOUNTS_ONLY and nick in list_players():
|
||||||
leave(cli, "account", nick)
|
leave(cli, "account", nick)
|
||||||
@ -1363,12 +1364,12 @@ def on_account(cli, rnick, acc):
|
|||||||
var.USERS[nick]["host"] = host
|
var.USERS[nick]["host"] = host
|
||||||
var.USERS[nick]["account"] = acc
|
var.USERS[nick]["account"] = acc
|
||||||
if nick in var.DISCONNECTED.keys():
|
if nick in var.DISCONNECTED.keys():
|
||||||
if acc == var.DISCONNECTED[nick][0]:
|
if lacc == var.DISCONNECTED[nick][0]:
|
||||||
if nick in var.USERS and var.USERS[nick]["inchan"]:
|
if nick in var.USERS and var.USERS[nick]["inchan"]:
|
||||||
with var.GRAVEYARD_LOCK:
|
with var.GRAVEYARD_LOCK:
|
||||||
hm = var.DISCONNECTED[nick][1]
|
hm = var.DISCONNECTED[nick][1]
|
||||||
act = var.DISCONNECTED[nick][0]
|
act = var.DISCONNECTED[nick][0]
|
||||||
if (acc == act and not var.DISABLE_ACCOUNTS) or (hostmask == hm and not var.ACCOUNTS_ONLY):
|
if (lacc == act and not var.DISABLE_ACCOUNTS) or (hostmask == hm and not var.ACCOUNTS_ONLY):
|
||||||
cli.mode(chan, "+v", nick, nick+"!*@*")
|
cli.mode(chan, "+v", nick, nick+"!*@*")
|
||||||
del var.DISCONNECTED[nick]
|
del var.DISCONNECTED[nick]
|
||||||
var.LAST_SAID_TIME[nick] = datetime.now()
|
var.LAST_SAID_TIME[nick] = datetime.now()
|
||||||
@ -3317,11 +3318,12 @@ def on_join(cli, raw_nick, chan, acc="*", rname=""):
|
|||||||
if chan != botconfig.CHANNEL:
|
if chan != botconfig.CHANNEL:
|
||||||
return
|
return
|
||||||
with var.GRAVEYARD_LOCK:
|
with var.GRAVEYARD_LOCK:
|
||||||
hostmask = ident + "@" + host
|
hostmask = irc_lower(ident) + "@" + host.lower()
|
||||||
|
lacc = irc_lower(acc)
|
||||||
if nick in var.DISCONNECTED.keys():
|
if nick in var.DISCONNECTED.keys():
|
||||||
hm = var.DISCONNECTED[nick][1]
|
hm = var.DISCONNECTED[nick][1]
|
||||||
act = var.DISCONNECTED[nick][0]
|
act = var.DISCONNECTED[nick][0]
|
||||||
if (acc == act and not var.DISABLE_ACCOUNTS) or (hostmask == hm and not var.ACCOUNTS_ONLY):
|
if (lacc == act and not var.DISABLE_ACCOUNTS) or (hostmask == hm and not var.ACCOUNTS_ONLY):
|
||||||
if not var.DEVOICE_DURING_NIGHT or var.PHASE != "night":
|
if not var.DEVOICE_DURING_NIGHT or var.PHASE != "night":
|
||||||
cli.mode(chan, "+v", nick, nick+"!*@*")
|
cli.mode(chan, "+v", nick, nick+"!*@*")
|
||||||
del var.DISCONNECTED[nick]
|
del var.DISCONNECTED[nick]
|
||||||
|
Loading…
Reference in New Issue
Block a user