protect_and_chanowner_in_unrealircd

Add protectet users (&) und the channelowner (~) used in unrealircd to the ops list.
This commit is contained in:
Marius Rieder 2005-11-01 04:49:23 +00:00
parent e5be124e5a
commit cbb5b7aaa2

View File

@ -248,13 +248,13 @@ class ChannelState(object):
def addUser(self, user): def addUser(self, user):
"Adds a given user to the ChannelState. Power prefixes are handled." "Adds a given user to the ChannelState. Power prefixes are handled."
nick = user.lstrip('@%+') nick = user.lstrip('@%+&~')
if not nick: if not nick:
return return
while user and user[0] in '@%+': while user and user[0] in '@%+&~':
(marker, user) = (user[0], user[1:]) (marker, user) = (user[0], user[1:])
assert user, 'Looks like my caller is passing chars, not nicks.' assert user, 'Looks like my caller is passing chars, not nicks.'
if marker == '@': if marker in '@&~':
self.ops.add(nick) self.ops.add(nick)
elif marker == '%': elif marker == '%':
self.halfops.add(nick) self.halfops.add(nick)