Compare commits

..

No commits in common. "fdffef6e139c54d28f1283b3831656f0d152defc" and "840265c745e668addfcd4afa741f7835cd98dca9" have entirely different histories.

View File

@ -7,17 +7,16 @@ def ircregister(username, password, email):
d = irctokens.StatefulDecoder()
e = irctokens.StatefulEncoder()
s = socket.socket()
securesocket = ssl.create_default_context().wrap_socket(s, server_hostname="irc.casa")
#connecting to the server
securesocket.connect(("theia.psyched.dev", 6697))
s.connect(("127.0.0.1", 6667))
#defining the send function with proper formatting
def _send(line):
print(f"> {line.format()}")
e.push(line)
while e.pending():
e.pop(securesocket.send(e.pending()))
e.pop(s.send(e.pending()))
# registering the connection to the server
_send(irctokens.build("USER", [username, "0", "*", username]))
@ -34,7 +33,7 @@ def ircregister(username, password, email):
# go through the cases
while True:
lines = d.push(securesocket.recv(1024))
lines = d.push(s.recv(1024))
if lines == None: # if nothing is received from server
return "server error"