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

Move squit() to ircs2s_common

This commit is contained in:
James Lu 2017-07-04 23:41:00 -07:00
parent 9132556fd9
commit 5d4f2149e6
3 changed files with 7 additions and 13 deletions

View File

@ -376,12 +376,6 @@ class InspIRCdProtocol(TS6BaseProtocol):
self._send_with_prefix(sid, 'ENDBURST')
return sid
def squit(self, source, target, text='No reason given'):
"""SQUITs a PyLink server."""
# -> :9PY SQUIT 9PZ :blah, blah
self._send_with_prefix(source, 'SQUIT %s :%s' % (target, text))
self.handle_squit(source, 'SQUIT', [target, text])
### Core / command handlers
def post_connect(self):

View File

@ -394,6 +394,13 @@ class IRCS2SProtocol(IRCCommonProtocol):
self._send_with_prefix(numeric, 'NOTICE %s :%s' % (target, text))
def squit(self, source, target, text='No reason given'):
"""SQUITs a PyLink server."""
# -> SQUIT 9PZ :blah, blah
log.debug('(%s) squit: source=%s, target=%s', self.name, source, target)
self._send_with_prefix(source, 'SQUIT %s :%s' % (target, text))
self.handle_squit(source, 'SQUIT', [target, text])
def topic(self, numeric, target, text):
"""Sends a TOPIC change from a PyLink client."""
if not self.is_internal_client(numeric):

View File

@ -214,13 +214,6 @@ class TS6BaseProtocol(IRCS2SProtocol):
self.servers[sid] = Server(uplink, name, internal=True, desc=desc)
return sid
def squit(self, source, target, text='No reason given'):
"""SQUITs a PyLink server."""
# -> SQUIT 9PZ :blah, blah
log.debug('source=%s, target=%s', source, target)
self._send_with_prefix(source, 'SQUIT %s :%s' % (target, text))
self.handle_squit(source, 'SQUIT', [target, text])
def away(self, source, text):
"""Sends an AWAY message from a PyLink client. <text> can be an empty string
to unset AWAY status."""