Skip to content
Snippets Groups Projects
Commit c8ed88be authored by Peter Tseng's avatar Peter Tseng Committed by Dominik Honnef
Browse files

Don't remove plugin hooks accidentally

Under certain code paths, using select! instead of select would lead to
modifying the plugin's hooks, instead of just a local copy. This
effectively broke hooks when using more than one event type.

Fixes gh-207
parent b310ede2
No related branches found
No related tags found
No related merge requests found
......@@ -310,7 +310,7 @@ module Cinch
if hooks.is_a?(Hash)
hooks = hooks.map { |k, v| v }
end
hooks.select! { |hook| (events & hook.for).size > 0 }
hooks = hooks.select { |hook| (events & hook.for).size > 0 }
end
return hooks.select { |hook| hook.group.nil? || hook.group == group }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment