3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 21:19:31 +01:00

protocols: rename nickClient(...) -> nick(...)

This commit is contained in:
James Lu 2016-01-16 16:51:04 -08:00
parent 196282db86
commit 7e5284969d
5 changed files with 6 additions and 6 deletions

View File

@ -64,7 +64,7 @@ internals](https://github.com/GLolol/PyLink/blob/0.4.0-dev/classes.py#L267-L272)
- **`modeServer`**`(self, source, target, modes, ts=None)` - Sends modes from a PyLink server.
- **`nickClient`**`(self, source, newnick)` - Changes the nick of a PyLink client.
- **`nick`**`(self, source, newnick)` - Changes the nick of a PyLink client.
- **`notice`**`(self, source, target, text)` - Sends a NOTICE from a PyLink client.

View File

@ -94,7 +94,7 @@ def nick(irc, source, args):
elif not utils.isManipulatableClient(irc, u):
irc.reply("Error: Cannot force nick changes for a protected PyLink services client.")
return
irc.proto.nickClient(u, newnick)
irc.proto.nick(u, newnick)
irc.callHooks([u, 'PYLINK_BOTSPLUGIN_NICK', {'newnick': newnick, 'oldnick': nick, 'parse_as': 'NICK'}])
@utils.add_cmd

View File

@ -688,7 +688,7 @@ def handle_nick(irc, numeric, command, args):
remoteirc = world.networkobjects[netname]
newnick = normalizeNick(remoteirc, irc.name, args['newnick'], uid=user)
if remoteirc.users[user].nick != newnick:
remoteirc.proto.nickClient(user, newnick)
remoteirc.proto.nick(user, newnick)
utils.add_hook(handle_nick, 'NICK')
def handle_part(irc, numeric, command, args):
@ -1084,7 +1084,7 @@ def handle_save(irc, numeric, command, args):
newnick = normalizeNick(irc, remotenet, nick)
log.info('(%s) SAVE received for relay client %r (%s), fixing nick to %s',
irc.name, target, nick, newnick)
irc.proto.nickClient(target, newnick)
irc.proto.nick(target, newnick)
else:
log.warning('(%s) SAVE received for relay client %r (%s), not '
'fixing nick again due to 5 failed attempts in '

View File

@ -64,7 +64,7 @@ class TS6BaseProtocol(Protocol):
raise LookupError('No such PyLink server exists.')
self._sendKick(numeric, channel, target, reason=reason)
def nickClient(self, numeric, newnick):
def nick(self, numeric, newnick):
"""Changes the nick of a PyLink client."""
if not self.irc.isInternalClient(numeric):
raise LookupError('No such PyLink client exists.')

View File

@ -55,7 +55,7 @@ class CommonProtoTestCase(PluginTestCase):
self.assertEqual(cmds, ['MODE', 'FMODE'])
def testNickClient(self):
self.proto.nickClient(self.u, 'NotPyLink')
self.proto.nick(self.u, 'NotPyLink')
self.assertEqual('NotPyLink', self.irc.users[self.u].nick)
def testPartClient(self):