try before connect logic

This commit is contained in:
Pratyush Desai 2022-08-31 17:34:32 +05:30
parent 1525887c9d
commit 6ad857ed29
Signed by: pratyush
GPG Key ID: DBA5BB7505946FAD

View File

@ -37,12 +37,11 @@ def ircregister(userip, username, password, email="*"):
# Inform the server that we support # Inform the server that we support
# CAP 3.2 # CAP 3.2
_send(irctokens.build("CAP", ["LS", "302"])) _send(irctokens.build("CAP", ["LS", "302"]))
# lines = d.push(s.recv(1024))
# REGISTER can be attempted before-connect if server supports if 'draft/account-registration=before-connnect' in lines.params:
# but if the server responds with the corresponding FAIL we # add extra conditional for custom account and email-required
# need to try again. We can also handle email-required using _send(irctokens.build("REGISTER" ["*", password]))
# the same keys. How to access these key-value pairs? else:
# reference: https://github.com/ProgVal/ircv3-specifications/blob/register/extensions/account-registration.md#commands
# NICK and USER # NICK and USER
_send(irctokens.build("USER", ["u", "0", "*", username])) _send(irctokens.build("USER", ["u", "0", "*", username]))