mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-17 06:00:42 +01:00
Fixed bug #846332.
This commit is contained in:
parent
43c594661c
commit
0da5c27380
@ -122,6 +122,10 @@ class Topic(callbacks.Privmsg):
|
|||||||
topics = self._splitTopic(irc.state.getTopic(channel))
|
topics = self._splitTopic(irc.state.getTopic(channel))
|
||||||
if topics:
|
if topics:
|
||||||
try:
|
try:
|
||||||
|
match = self.topicUnformatter.match(topics[number])
|
||||||
|
if match:
|
||||||
|
irc.reply(msg, match.group(1))
|
||||||
|
else:
|
||||||
irc.reply(msg, topics[number])
|
irc.reply(msg, topics[number])
|
||||||
except IndexError:
|
except IndexError:
|
||||||
irc.error(msg, 'That\'s not a valid topic.')
|
irc.error(msg, 'That\'s not a valid topic.')
|
||||||
|
@ -50,8 +50,11 @@ class TopicTestCase(ChannelPluginTestCase, PluginDocumentation):
|
|||||||
_ = self.getMsg('topic add bar')
|
_ = self.getMsg('topic add bar')
|
||||||
_ = self.getMsg('topic add baz')
|
_ = self.getMsg('topic add baz')
|
||||||
self.assertRegexp('topic get 1', '^foo')
|
self.assertRegexp('topic get 1', '^foo')
|
||||||
|
self.assertNotRegexp('topic get 1', self.nick)
|
||||||
self.assertRegexp('topic get 2', '^bar')
|
self.assertRegexp('topic get 2', '^bar')
|
||||||
|
self.assertNotRegexp('topic get 2', self.nick)
|
||||||
self.assertRegexp('topic get 3', '^baz')
|
self.assertRegexp('topic get 3', '^baz')
|
||||||
|
self.assertNotRegexp('topic get 3', self.nick)
|
||||||
self.assertError('topic get 0')
|
self.assertError('topic get 0')
|
||||||
|
|
||||||
def testTopicAdd(self):
|
def testTopicAdd(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user