Merge pull request #1018 from nyuszika7h/request-multi-prefix-cap

Fix commit 30a026a
This commit is contained in:
Valentin Lorentz 2015-01-19 18:18:55 +01:00
commit 09faec8e9e
2 changed files with 14 additions and 7 deletions

View File

@ -962,8 +962,8 @@ class Irc(IrcCommandDispatcher):
elif self.sasl_username and self.sasl_password:
self.sasl = 'plain'
self.queueMsg(ircmsgs.IrcMsg(command='CAP', args=('REQ',
'account-notify extended-join multi-prefix')))
for cap in ('account-notify', 'extended-join', 'multi-prefix'):
self.queueMsg(ircmsgs.IrcMsg(command='CAP', args=('REQ', cap)))
if self.sasl:
self.queueMsg(ircmsgs.IrcMsg(command='CAP', args=('REQ', 'sasl')))

View File

@ -387,6 +387,10 @@ class IrcTestCase(SupyTestCase):
m = self.irc.takeMsg()
self.failUnless(m.command == 'CAP', 'Expected CAP, got %r.' % m)
m = self.irc.takeMsg()
self.failUnless(m.command == 'CAP', 'Expected CAP, got %r.' % m)
m = self.irc.takeMsg()
self.failUnless(m.command == 'CAP', 'Expected CAP, got %r.' % m)
m = self.irc.takeMsg()
self.failUnless(m.command == 'USER', 'Expected USER, got %r.' % m)
def testPingResponse(self):
@ -483,11 +487,14 @@ class IrcCallbackTestCase(SupyTestCase):
conf.supybot.nick.setValue(nick)
user = 'user any user'
conf.supybot.user.setValue(user)
expected = [ircmsgs.nick(nick),
ircmsgs.IrcMsg(command='CAP', args=('REQ',
'account-notify extended-join multi-prefix')),
expected = [
ircmsgs.nick(nick),
ircmsgs.IrcMsg(command='CAP', args=('REQ', 'account-notify')),
ircmsgs.IrcMsg(command='CAP', args=('REQ', 'extended-join')),
ircmsgs.IrcMsg(command='CAP', args=('REQ', 'multi-prefix')),
ircmsgs.IrcMsg(command='CAP', args=('END',)),
ircmsgs.user('limnoria', user)]
ircmsgs.user('limnoria', user)
]
irc = irclib.Irc('test')
msgs = [irc.takeMsg()]
while msgs[-1] != None: