mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 11:42:52 +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
|
||||
# Let's do this so even if the plugin isn't currently loaded, it doesn't
|
||||
# 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)
|
||||
callbacks = irc.removeCallback(name)
|
||||
if callbacks:
|
||||
@ -507,7 +512,7 @@ class Owner(callbacks.Plugin):
|
||||
del callback
|
||||
gc.collect()
|
||||
irc.replySuccess()
|
||||
else:
|
||||
return
|
||||
irc.error('There was no plugin %s.' % name)
|
||||
unload = wrap(unload, ['something'])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user