From c2e65ff9c395c85e81a1b621848188a4df3731a2 Mon Sep 17 00:00:00 2001 From: James Lu Date: Wed, 5 Jul 2017 00:56:34 -0700 Subject: [PATCH] IRCCommonProtocol: alias topic_burst to topic by default (#480) --- protocols/ircs2s_common.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/protocols/ircs2s_common.py b/protocols/ircs2s_common.py index e462aed..9fda443 100644 --- a/protocols/ircs2s_common.py +++ b/protocols/ircs2s_common.py @@ -428,13 +428,17 @@ class IRCS2SProtocol(IRCCommonProtocol): 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): - raise LookupError('No such PyLink client exists.') - self._send_with_prefix(numeric, 'TOPIC %s :%s' % (target, text)) + def topic(self, source, target, text): + """Sends a TOPIC change from a PyLink client or server.""" + if (not self.is_internal_client(source)) and (not self.is_internal_server(source)): + raise LookupError('No such PyLink client/server exists.') + + target = self.to_lower(target) + + self._send_with_prefix(source, 'TOPIC %s :%s' % (target, text)) self.channels[target].topic = text self.channels[target].topicset = True + topic_burst = topic def check_nick_collision(self, nick): """