def do315(self, irc, msg):
        # Try to restore the topic when not set yet.
        channel = msg.args[1]
        c = irc.state.channels.get(channel)
        if c is None or not self.registryValue('setOnJoin', channel):
            return
        if irc.nick not in c.ops and 't' in c.modes:
            self.log.debug('Not trying to restore topic in %s. I\'m not opped '
                           'and %s is +t.', channel, channel)
            return
        try:
            topics = self.lastTopics[channel]
        except __HOLE__:
            self.log.debug('No topic to auto-restore in %s.', channel)
        else:
            newTopic = self._formatTopics(irc, channel, topics)
            if c.topic == '' or (c.topic != newTopic and
                                 self.registryValue('alwaysSetOnJoin', channel)):
                self._sendTopics(irc, channel, newTopic)
dataset/ETHPy150Open ProgVal/Limnoria/plugins/Topic/plugin.py/Topic.do315