3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

Make IrcUser.modes a set

This commit is contained in:
James Lu 2015-06-20 20:58:25 -07:00
parent d3257f9314
commit aeb53a14e3
3 changed files with 4 additions and 7 deletions

View File

@ -1,7 +1,7 @@
class IrcUser():
def __init__(self, nick, ts, uid, ident='null', host='null',
realname='PyLink dummy client', realhost='null',
ip='0.0.0.0', modes=[]):
ip='0.0.0.0', modes=set()):
self.nick = nick
self.ts = ts
self.uid = uid

View File

@ -127,7 +127,7 @@ def connect(irc):
# :751 UID 751AAAAAA 1220196319 Brain brainwave.brainbox.cc
# netadmin.chatspike.net brain 192.168.1.10 1220196324 +Siosw
# +ACKNOQcdfgklnoqtx :Craig Edwards
irc.pseudoclient = spawnClient(irc, 'PyLink', 'pylink', host, modes=["+o"])
irc.pseudoclient = spawnClient(irc, 'PyLink', 'pylink', host, modes=set(["+o"]))
f(':%s ENDBURST' % (irc.sid))
for chan in irc.serverdata['channels']:
joinClient(irc, irc.pseudoclient.uid, chan)

View File

@ -79,13 +79,10 @@ def applyModes(modelist, changedmodes):
for mode in changedmodes:
if mode[0] == '+':
# We're adding a mode
modelist.append(mode)
modelist.add(mode)
else:
# We're removing a mode
try:
modelist.remove(mode)
except ValueError:
print('Attempted to remove modes %r not in %s\'s modes' % (mode, numeric))
modelist.discard(mode)
return modelist
def joinModes(modes):