Fixed irclib.Channel to use ircutils.nick on its stuff.

This commit is contained in:
Jeremy Fincher 2003-06-16 04:56:06 +00:00
parent d9399fb304
commit f8a54c4872
2 changed files with 5 additions and 2 deletions

View File

@ -156,7 +156,7 @@ class Channel(object):
self.voices = set()
def addUser(self, user):
nick = user.lstrip('@%+')
nick = ircutils.nick(user.lstrip('@%+'))
while user and user[0] in '@%+':
(marker, user) = (user[0], user[1:])
if marker == '@':
@ -171,12 +171,15 @@ class Channel(object):
# 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
# without changing any of his categories.
oldNick = ircutils.nick(oldNick)
newNick = ircutils.nick(newNick)
for s in (self.users, self.ops, self.halfops, self.voices):
if oldNick in s:
s.discard(oldNick)
s.add(newNick)
def removeUser(self, user):
user = ircutils.nick(user)
self.users.discard(user)
self.ops.discard(user)
self.halfops.discard(user)

View File

@ -203,7 +203,7 @@ class IrcTestCase(unittest.TestCase):
self.failIf(self.irc.fastqueue)
self.failIf(self.irc.state.history)
self.failIf(self.irc.state.channels)
self.failIf(self.irc.outstandingPongs)
self.failIf(self.irc.outstandingPing)
self.assertEqual(self.irc._nickmods, conf.nickmods)
def testHistory(self):