diff --git a/protocols/ts6.py b/protocols/ts6.py index 427b28c..c30fe00 100644 --- a/protocols/ts6.py +++ b/protocols/ts6.py @@ -239,14 +239,6 @@ class TS6Protocol(TS6BaseProtocol): else: self._send(source, 'PING %s' % source) - def awayClient(self, source, text): - """Sends an AWAY message from a PyLink client. can be an empty string - to unset AWAY status.""" - if text: - self._send(source, 'AWAY :%s' % text) - else: - self._send(source, 'AWAY') - def connect(self): """Initializes a connection to a server.""" ts = self.irc.start_ts @@ -645,13 +637,4 @@ class TS6Protocol(TS6BaseProtocol): 'your IRCd configuration.', self.irc.name, setter, badmode, charlist[badmode]) - def handle_away(self, numeric, command, args): - """Handles incoming AWAY messages.""" - # <- :6ELAAAAAB AWAY :Auto-away - try: - self.irc.users[numeric].away = text = args[0] - except IndexError: # User is unsetting away status - self.irc.users[numeric].away = text = '' - return {'text': text} - Class = TS6Protocol diff --git a/protocols/ts6_common.py b/protocols/ts6_common.py index a028a7f..ae8a503 100644 --- a/protocols/ts6_common.py +++ b/protocols/ts6_common.py @@ -139,6 +139,14 @@ class TS6BaseProtocol(Protocol): self._send(source, 'SQUIT %s :%s' % (target, text)) self.handle_squit(source, 'SQUIT', [target, text]) + def awayClient(self, source, text): + """Sends an AWAY message from a PyLink client. can be an empty string + to unset AWAY status.""" + if text: + self._send(source, 'AWAY :%s' % text) + else: + self._send(source, 'AWAY') + ### HANDLERS def handle_privmsg(self, source, command, args): @@ -262,3 +270,12 @@ class TS6BaseProtocol(Protocol): if not (self.irc.channels[channel].users or ((self.irc.cmodes.get('permanent'), None) in self.irc.channels[channel].modes)): del self.irc.channels[channel] return {'channels': channels, 'text': reason} + + def handle_away(self, numeric, command, args): + """Handles incoming AWAY messages.""" + # <- :6ELAAAAAB AWAY :Auto-away + try: + self.irc.users[numeric].away = text = args[0] + except IndexError: # User is unsetting away status + self.irc.users[numeric].away = text = '' + return {'text': text}