fix conditional for checking ACK and NAK

This commit is contained in:
Pratyush Desai 2021-07-16 21:00:36 +05:30
parent 734d5e7f84
commit 1499693b04
No known key found for this signature in database
GPG Key ID: EAA4FD0FB5CACA61

View File

@ -58,9 +58,9 @@ def ircregister(userip, username, password, email="*"):
elif line.command == "433": elif line.command == "433":
return "ERR_NICKNAMEINUSE" return "ERR_NICKNAMEINUSE"
_send(irctokens.build("CAP", ["REQ", "draft/account-registration"])) _send(irctokens.build("CAP", ["REQ", "draft/account-registration"]))
if line.command == "CAP" and line.params == ["*", "NAK", "draft/account-registration"]: if line.command == "CAP" and ("NAK" in line.params):
return "cap refused" return "cap refused"
elif line.command == "CAP" and line.params == ["*", "ACK", "draft/account-registration"]: elif line.command == "CAP" and ("ACK" in line.params):
to_send = irctokens.build("CAP", ["END"]) to_send = irctokens.build("CAP", ["END"])
_send(to_send) _send(to_send)
if line.command == "PING": if line.command == "PING":