Fixing loopholes

This commit is contained in:
Firepup Sixfifty 2023-11-04 21:45:21 -05:00
parent 69d601042e
commit a45581bb0a

View file

@ -257,7 +257,7 @@ def op(name, chan):
def main():
try:
global ircmsg, channels, e, gmode, prefix, rebt, gblrebt, lrebt, lgblrebt, blanks
global channels, e, gmode, prefix, rebt, gblrebt, lrebt, lgblrebt, blanks
log("Starting connection..", server)
joinserver()
if "pass" in servers[server]:
@ -266,19 +266,19 @@ def main():
for chan in channels:
joinchan(chan, "null", channels, False)
while 1:
global ircmsg, gmode
global gmode
raw = recv()
ircmsg = raw.decode()
if ircmsg == "":
exit("Probably a netsplit")
else:
print(raw.lazy_decode(), sep="\n")
if ircmsg.find("PRIVMSG") != -1:
action = "Unknown"
try:
ircmsg.split("PRIVMSG", 1)[1]
action = ircmsg.split(" ", 2)[1].strip()
except IndexError:
log("Fake message recieved", server, "WARN")
continue
pass
if action == "PRIVMSG":
# Format of ":[Nick]![ident]@[host|vhost] PRIVMSG [channel] :[message]”
name = ircmsg.split("!", 1)[0][1:]
helpErr = False