patch by braph: refactor muc_online events into own plugin class

This commit is contained in:
Thorsten
2016-04-02 00:50:29 +02:00
parent 4150137414
commit 89db85ad59
4 changed files with 77 additions and 42 deletions

View File

@@ -5,8 +5,8 @@ import traceback
import types
import config
from common import RATE_NO_LIMIT, pluginfunction, ptypes_PARSE, ptypes_COMMAND, ptypes
from plugins import commands, parsers
from common import RATE_NO_LIMIT, pluginfunction, ptypes_PARSE, ptypes_COMMAND, ptypes_MUC_ONLINE, ptypes
from plugins import commands, parsers, muc_online
joblist = []
plugins = {p: [] for p in ptypes}
@@ -77,6 +77,8 @@ def register(func_type):
plugin_funcs = list(commands.__dict__.values()) + local_commands
elif func_type == ptypes_PARSE:
plugin_funcs = parsers.__dict__.values()
elif func_type == ptypes_MUC_ONLINE:
plugin_funcs = muc_online.__dict__.values()
else:
raise RuntimeError("invalid func type: {}".format(func_type))
@@ -107,6 +109,7 @@ def register_plugin(function, func_type):
def register_all():
register(ptypes_PARSE)
register(ptypes_COMMAND)
register(ptypes_MUC_ONLINE)
def event_trigger():