3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-10-14 15:37:31 +02:00

protocols: rename _getOutgoingNick() -> _expandPUID()

This commit is contained in:
James Lu 2016-07-17 20:51:00 -07:00
parent e0b254e6ad
commit 8981d71fd0
2 changed files with 6 additions and 6 deletions

View File

@ -113,7 +113,7 @@ class TS6BaseProtocol(IRCS2SProtocol):
"""Sends a TS6-style raw command from a source numeric to the self.irc connection given.""" """Sends a TS6-style raw command from a source numeric to the self.irc connection given."""
self.irc.send(':%s %s' % (source, msg)) self.irc.send(':%s %s' % (source, msg))
def _getOutgoingNick(self, uid): def _expandPUID(self, uid):
""" """
Returns the outgoing nick for the given UID. In the base ts6_common implementation, Returns the outgoing nick for the given UID. In the base ts6_common implementation,
this does nothing, but other modules subclassing this can override it. this does nothing, but other modules subclassing this can override it.
@ -128,7 +128,7 @@ class TS6BaseProtocol(IRCS2SProtocol):
"""Sends raw numerics from a server to a remote client, used for WHOIS """Sends raw numerics from a server to a remote client, used for WHOIS
replies.""" replies."""
# Mangle the target for IRCds that require it. # Mangle the target for IRCds that require it.
target = self._getOutgoingNick(target) target = self._expandPUID(target)
self._send(source, '%s %s %s' % (numeric, target, text)) self._send(source, '%s %s %s' % (numeric, target, text))
@ -144,7 +144,7 @@ class TS6BaseProtocol(IRCS2SProtocol):
reason = 'No reason given' reason = 'No reason given'
# Mangle kick targets for IRCds that require it. # Mangle kick targets for IRCds that require it.
target = self._getOutgoingNick(target) target = self._expandPUID(target)
self._send(numeric, 'KICK %s %s :%s' % (channel, target, reason)) self._send(numeric, 'KICK %s %s :%s' % (channel, target, reason))
@ -224,7 +224,7 @@ class TS6BaseProtocol(IRCS2SProtocol):
raise LookupError('No such PyLink client exists.') raise LookupError('No such PyLink client exists.')
# Mangle message targets for IRCds that require it. # Mangle message targets for IRCds that require it.
target = self._getOutgoingNick(target) target = self._expandPUID(target)
self._send(numeric, 'PRIVMSG %s :%s' % (target, text)) self._send(numeric, 'PRIVMSG %s :%s' % (target, text))
@ -234,7 +234,7 @@ class TS6BaseProtocol(IRCS2SProtocol):
raise LookupError('No such PyLink client exists.') raise LookupError('No such PyLink client exists.')
# Mangle message targets for IRCds that require it. # Mangle message targets for IRCds that require it.
target = self._getOutgoingNick(target) target = self._expandPUID(target)
self._send(numeric, 'NOTICE %s :%s' % (target, text)) self._send(numeric, 'NOTICE %s :%s' % (target, text))

View File

@ -41,7 +41,7 @@ class UnrealProtocol(TS6BaseProtocol):
log.warning('(%s) mixed_link is experimental and may cause problems. ' log.warning('(%s) mixed_link is experimental and may cause problems. '
'You have been warned!', self.irc.name) 'You have been warned!', self.irc.name)
def _getOutgoingNick(self, uid): def _expandPUID(self, uid):
""" """
Returns the outgoing nick for the given UID. For PUIDs (used to store UID-less Returns the outgoing nick for the given UID. For PUIDs (used to store UID-less
3.2 users), this will change the PUID given to the actual user's nick, 3.2 users), this will change the PUID given to the actual user's nick,