mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-19 08:59:27 +01:00
Owner: fix 'unload' writing duplicate entries to supybot.plugins
Fetch the existing plugin callback to determine the plugin's name in the right case. Closes #1295.
This commit is contained in:
parent
2ba7bc5c16
commit
ec2cf4af37
@ -499,6 +499,11 @@ class Owner(callbacks.Plugin):
|
|||||||
return
|
return
|
||||||
# Let's do this so even if the plugin isn't currently loaded, it doesn't
|
# Let's do this so even if the plugin isn't currently loaded, it doesn't
|
||||||
# stay attempting to load.
|
# stay attempting to load.
|
||||||
|
old_callback = irc.getCallback(name)
|
||||||
|
if old_callback:
|
||||||
|
# Normalize the plugin case to prevent duplicate registration
|
||||||
|
# entries, https://github.com/ProgVal/Limnoria/issues/1295
|
||||||
|
name = old_callback.name()
|
||||||
conf.registerPlugin(name, False)
|
conf.registerPlugin(name, False)
|
||||||
callbacks = irc.removeCallback(name)
|
callbacks = irc.removeCallback(name)
|
||||||
if callbacks:
|
if callbacks:
|
||||||
@ -507,7 +512,7 @@ class Owner(callbacks.Plugin):
|
|||||||
del callback
|
del callback
|
||||||
gc.collect()
|
gc.collect()
|
||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
else:
|
return
|
||||||
irc.error('There was no plugin %s.' % name)
|
irc.error('There was no plugin %s.' % name)
|
||||||
unload = wrap(unload, ['something'])
|
unload = wrap(unload, ['something'])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user