Implement API for authentication management actions
This commit is contained in:
12
core/bot.py
12
core/bot.py
@@ -55,7 +55,7 @@ class IRCBot(IRCClient):
|
||||
self.isconnected = False
|
||||
self.channels = []
|
||||
self.net = net
|
||||
self.authenticated = not regproc.needToRegister(self.net)
|
||||
self.authenticated = not regproc.needToAuth(self.net)
|
||||
self.num = num
|
||||
self.buffer = ""
|
||||
self.name = net + str(num)
|
||||
@@ -621,8 +621,9 @@ class IRCBot(IRCClient):
|
||||
def regPing(self, negativepass=None):
|
||||
if self.authenticated:
|
||||
return
|
||||
if not regproc.needToRegister(self.net):
|
||||
if not regproc.needToAuth(self.net):
|
||||
self.authenticated = True
|
||||
return
|
||||
sinst = regproc.substitute(self.net, self.num)
|
||||
if not sinst:
|
||||
error(f"regPing() {self.net}: registration ping failed for {self.num}")
|
||||
@@ -649,7 +650,12 @@ class IRCBot(IRCClient):
|
||||
if sinst["negative"]:
|
||||
self._negativePass = None
|
||||
self.msg(sinst["entity"], sinst["negativemsg"])
|
||||
debug(f"regPing() {self.net}: sent negativemsg '{sinst['negativemsg']}' to {sinst['entity']} - {self.num}")
|
||||
debug(
|
||||
(
|
||||
f"regPing() {self.net}: sent negativemsg "
|
||||
f"'{sinst['negativemsg']}' to {sinst['entity']} - {self.num}"
|
||||
)
|
||||
)
|
||||
return
|
||||
else:
|
||||
self._negativePass = True
|
||||
|
||||
Reference in New Issue
Block a user