mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-28 21:52:37 +01:00
Admin: @nick only sets the nick on the current network. Closes GH-273.
This commit is contained in:
parent
a15dea55db
commit
58befaee5c
@ -212,19 +212,21 @@ class Admin(callbacks.Plugin):
|
||||
self.log.debug('Got NICK without Admin.nick being called.')
|
||||
|
||||
@internationalizeDocstring
|
||||
def nick(self, irc, msg, args, nick):
|
||||
"""[<nick>]
|
||||
def nick(self, irc, msg, args, nick, network):
|
||||
"""[<nick>] [<network>]
|
||||
|
||||
Changes the bot's nick to <nick>. If no nick is given, returns the
|
||||
bot's current nick.
|
||||
"""
|
||||
network = network or irc.network
|
||||
if nick:
|
||||
conf.supybot.nick.setValue(nick)
|
||||
group = getattr(conf.supybot.networks, network)
|
||||
group.nick.setValue(nick)
|
||||
irc.queueMsg(ircmsgs.nick(nick))
|
||||
self.pendingNickChanges[irc.getRealIrc()] = irc
|
||||
else:
|
||||
irc.reply(irc.nick)
|
||||
nick = wrap(nick, [additional('nick')])
|
||||
nick = wrap(nick, [additional('nick'), additional('something')])
|
||||
|
||||
@internationalizeDocstring
|
||||
def part(self, irc, msg, args, channel, reason):
|
||||
|
@ -122,7 +122,7 @@ class AdminTestCase(PluginTestCase):
|
||||
self.assertEqual(m.command, 'NICK')
|
||||
self.assertEqual(m.args[0], 'foobar')
|
||||
finally:
|
||||
conf.supybot.nick.setValue(original)
|
||||
conf.supybot.networks.test.nick.setValue('')
|
||||
|
||||
def testAddCapabilityOwner(self):
|
||||
self.assertError('admin capability add %s owner' % self.nick)
|
||||
|
Loading…
Reference in New Issue
Block a user