This commit is contained in:
Jeremy Fincher 2003-11-21 12:35:24 +00:00
parent 43c594661c
commit 0da5c27380
2 changed files with 8 additions and 1 deletions

View File

@ -122,7 +122,11 @@ class Topic(callbacks.Privmsg):
topics = self._splitTopic(irc.state.getTopic(channel))
if topics:
try:
irc.reply(msg, topics[number])
match = self.topicUnformatter.match(topics[number])
if match:
irc.reply(msg, match.group(1))
else:
irc.reply(msg, topics[number])
except IndexError:
irc.error(msg, 'That\'s not a valid topic.')
else:

View File

@ -50,8 +50,11 @@ class TopicTestCase(ChannelPluginTestCase, PluginDocumentation):
_ = self.getMsg('topic add bar')
_ = self.getMsg('topic add baz')
self.assertRegexp('topic get 1', '^foo')
self.assertNotRegexp('topic get 1', self.nick)
self.assertRegexp('topic get 2', '^bar')
self.assertNotRegexp('topic get 2', self.nick)
self.assertRegexp('topic get 3', '^baz')
self.assertNotRegexp('topic get 3', self.nick)
self.assertError('topic get 0')
def testTopicAdd(self):