diff options
| author | 2019-07-30 15:09:34 +0100 | |
|---|---|---|
| committer | 2019-07-30 15:09:34 +0100 | |
| commit | ff0cc59507249da262535895129d9ec3258b56a5 (patch) | |
| tree | 595a84c54cd802f2db39ed266a04f0592a868fa5 /src/EventManager.py | |
| parent | Revert ".eat()ing privmsg/notice send should be high priority" (diff) | |
| signature | ||
hook priority position should default to 0, not end
Diffstat (limited to 'src/EventManager.py')
| -rw-r--r-- | src/EventManager.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/EventManager.py b/src/EventManager.py index 5a19f35e..b09847c4 100644 --- a/src/EventManager.py +++ b/src/EventManager.py @@ -148,14 +148,13 @@ class EventRoot(object): self._hooks[path_str] = [] hook_array = self._hooks[path_str] - hooked = False + hook_position = 0 for i, other_hook in enumerate(hook_array): if other_hook.priority > new_hook.priority: - hooked = True - hook_array.insert(i, new_hook) + hook_position = i break - if not hooked: - hook_array.append(new_hook) + + hook_array.insert(hook_position, new_hook) return new_hook def _call(self, path: typing.List[str], kwargs: dict, safe: bool, |
