Add refresh command

This commit is contained in:
Julian Paul Glass 2014-11-21 02:07:52 +00:00
parent 13c2bd3fcc
commit d35e67046b
1 changed files with 17 additions and 0 deletions

View File

@ -522,6 +522,23 @@ class Topic(callbacks.Plugin):
self._sendTopics(irc, channel, topics)
restore = wrap(restore, ['canChangeTopic'])
@internationalizeDocstring
def refresh(self, irc, msg, args, channel):
"""[<channel>]
Refreshes current topic set by anyone. Restores topic if empty.
<channel> is only necessary if the message isn't sent in the channel
itself.
"""
if not self._checkManageCapabilities(irc, msg, channel):
capabilities = self.registryValue('requireManageCapability')
irc.errorNoCapability(capabilities, raise=True)
topic = irc.state.channels[channel].topic
if topic:
self._sendTopics(irc, channel, topic)
else:
self.restore(self, irc, msg, args, channel)
set = wrap(refresh, ['canChangeTopic'])
@internationalizeDocstring
def undo(self, irc, msg, args, channel):
"""[<channel>]