Improve performance in userinfo

* Implement a nick -> user mapping, preventing a superfluous SSCAN on
the entire dataset for when networks are disconnected
* Use one thread for all channels when a network instance is
disconnected, instead of one thread per channel
* Made returns comprising of only a list into tuples
This commit is contained in:
2019-10-17 20:19:35 +01:00
parent a64765121a
commit f34de8940f
3 changed files with 88 additions and 76 deletions

15
utils/parsing.py Normal file
View File

@@ -0,0 +1,15 @@
def parsen(user):
step = user.split("!")
nick = step[0]
if len(step) == 2:
step2 = step[1].split("@")
if len(step2) == 2:
ident, host = step2
else:
ident = nick
host = nick
else:
ident = nick
host = nick
return (nick, ident, host)