mirror of
https://github.com/oddluck/limnoria-plugins.git
synced 2025-04-29 15:01:11 -05:00
SpiffyTitles: default handler enabled fixes
This commit is contained in:
parent
1312039c0f
commit
e3b05db876
@ -62,7 +62,6 @@ class SpiffyTitles(callbacks.Plugin):
|
|||||||
self.link_cache = {}
|
self.link_cache = {}
|
||||||
self.handlers = {}
|
self.handlers = {}
|
||||||
self.timeout = self.registryValue("timeout")
|
self.timeout = self.registryValue("timeout")
|
||||||
self.default_handler_enabled = self.registryValue("default.enabled")
|
|
||||||
self.add_handlers()
|
self.add_handlers()
|
||||||
|
|
||||||
def add_handlers(self):
|
def add_handlers(self):
|
||||||
@ -206,7 +205,7 @@ class SpiffyTitles(callbacks.Plugin):
|
|||||||
elif not is_ignored:
|
elif not is_ignored:
|
||||||
irc.reply(title, prefixNick=False)
|
irc.reply(title, prefixNick=False)
|
||||||
else:
|
else:
|
||||||
if self.default_handler_enabled:
|
if self.registryValue("default.enabled", channel):
|
||||||
log.debug("SpiffyTitles: could not get a title for %s" % (url))
|
log.debug("SpiffyTitles: could not get a title for %s" % (url))
|
||||||
else:
|
else:
|
||||||
log.debug(
|
log.debug(
|
||||||
@ -219,8 +218,7 @@ class SpiffyTitles(callbacks.Plugin):
|
|||||||
"""
|
"""
|
||||||
Default handler for websites
|
Default handler for websites
|
||||||
"""
|
"""
|
||||||
default_handler_enabled = self.registryValue("default.enabled", channel=channel)
|
if self.registryValue("default.enabled", channel):
|
||||||
if default_handler_enabled:
|
|
||||||
log.debug("SpiffyTitles: calling default handler for %s" % (url))
|
log.debug("SpiffyTitles: calling default handler for %s" % (url))
|
||||||
default_template = Template(
|
default_template = Template(
|
||||||
self.registryValue("default.template", channel=channel)
|
self.registryValue("default.template", channel=channel)
|
||||||
@ -267,7 +265,7 @@ class SpiffyTitles(callbacks.Plugin):
|
|||||||
handler = self.handlers[base_domain]
|
handler = self.handlers[base_domain]
|
||||||
title = handler(url, info, channel)
|
title = handler(url, info, channel)
|
||||||
else:
|
else:
|
||||||
if self.default_handler_enabled:
|
if self.registryValue("default.enabled", channel):
|
||||||
title = self.handler_default(url, channel)
|
title = self.handler_default(url, channel)
|
||||||
if title and not cached_link:
|
if title and not cached_link:
|
||||||
title = self.get_formatted_title(title, channel)
|
title = self.get_formatted_title(title, channel)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user