mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
TyopError
This commit is contained in:
parent
e689904c90
commit
725da854ce
@ -156,7 +156,9 @@ class Channel(object):
|
|||||||
self.voices = set()
|
self.voices = set()
|
||||||
|
|
||||||
def addUser(self, user):
|
def addUser(self, user):
|
||||||
nick = ircutils.nick(user.lstrip('@%+'))
|
nick = user.lstrip('@%+')
|
||||||
|
if not isinstance(nick, ircutils.nick):
|
||||||
|
nick = ircutils.nick(nick)
|
||||||
while user and user[0] in '@%+':
|
while user and user[0] in '@%+':
|
||||||
(marker, user) = (user[0], user[1:])
|
(marker, user) = (user[0], user[1:])
|
||||||
if marker == '@':
|
if marker == '@':
|
||||||
@ -171,15 +173,18 @@ class Channel(object):
|
|||||||
# Note that this doesn't have to have the sigil (@%+) that users
|
# Note that this doesn't have to have the sigil (@%+) that users
|
||||||
# have to have for addUser; it just changes the name of the user
|
# have to have for addUser; it just changes the name of the user
|
||||||
# without changing any of his categories.
|
# without changing any of his categories.
|
||||||
oldNick = ircutils.nick(oldNick)
|
if not isinstance(oldNick, ircutils.nick):
|
||||||
newNick = ircutils.nick(newNick)
|
oldNick = ircutils.nick(oldNick)
|
||||||
|
if not isinstance(newNick, ircutils.nick):
|
||||||
|
newNick = ircutils.nick(newNick)
|
||||||
for s in (self.users, self.ops, self.halfops, self.voices):
|
for s in (self.users, self.ops, self.halfops, self.voices):
|
||||||
if oldNick in s:
|
if oldNick in s:
|
||||||
s.discard(oldNick)
|
s.discard(oldNick)
|
||||||
s.add(newNick)
|
s.add(newNick)
|
||||||
|
|
||||||
def removeUser(self, user):
|
def removeUser(self, user):
|
||||||
user = ircutils.nick(user)
|
if not isinstance(user, ircutils.nick):
|
||||||
|
user = ircutils.nick(user)
|
||||||
self.users.discard(user)
|
self.users.discard(user)
|
||||||
self.ops.discard(user)
|
self.ops.discard(user)
|
||||||
self.halfops.discard(user)
|
self.halfops.discard(user)
|
||||||
|
Loading…
Reference in New Issue
Block a user