Compare commits

...

3 commits

Author SHA1 Message Date
3dc7261caf also ban cloak because ngircd's line matching is useless 2022-02-27 06:46:53 -07:00
60d6d97160 require spam to be in multiple channels
i dont know why we are entertaining pasting multiple
duplicate lines in a channel, but this commit will avoid
banning for that.
2022-02-24 04:01:43 -07:00
d3935c53cf disable WHO
joins are too speedy
2022-02-14 17:36:44 -07:00

11
bam.py
View file

@ -20,6 +20,10 @@ class Server(BaseServer):
self.__getattribute__("on_" + line.command.lower())(line) self.__getattribute__("on_" + line.command.lower())(line)
) )
# disable automatic WHOing
async def _next_who(self):
pass
async def line_send(self, line): async def line_send(self, line):
print(f"{self.name} > {line.format()}") print(f"{self.name} > {line.format()}")
@ -33,8 +37,9 @@ class Server(BaseServer):
if line.params[1] in self.isoper: if line.params[1] in self.isoper:
self.isoper.remove(line.params[1]) self.isoper.remove(line.params[1])
return return
await self.send_raw(BADLINE.format(line.params[2].split()[3]))
await self.send_raw(KILL.format(line.params[1])) await self.send_raw(KILL.format(line.params[1]))
await self.send_raw(BADLINE.format(line.params[2].split()[3]))
await self.send_raw(BADLINE.format(line.params[2].split()[4]))
async def on_privmsg(self, line): async def on_privmsg(self, line):
nick = line.hostmask.nickname nick = line.hostmask.nickname
@ -51,10 +56,14 @@ class Server(BaseServer):
self.log[nick].pop(0) self.log[nick].pop(0)
return return
channels = []
for msg in self.log[nick][:-1]: for msg in self.log[nick][:-1]:
channels.append(msg[1])
if msg[2] != line.params[1]: if msg[2] != line.params[1]:
return return
if len(set(channels)) < 2:
return
await self.send(build("WHOIS",[nick,nick])) await self.send(build("WHOIS",[nick,nick]))
await self.send_raw(LOG.format(nick,','.join(set([ln[1] for ln in self.log[nick]])))) await self.send_raw(LOG.format(nick,','.join(set([ln[1] for ln in self.log[nick]]))))