Skip to content
Snippets Groups Projects
Commit 1aa34e05 authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

plugin now have to register the message types they want to recieve

parent 60fdfc66
No related branches found
No related tags found
No related merge requests found
......@@ -495,6 +495,10 @@ class GajimCore:
self.hub.sendPlugin('LOG_LINE', ev[1], (ev[2][0], nb, \
lineSplited[0], lineSplited[1], lineSplited[2:]))
fic.close()
#('REG_MESSAGE', module, list_message)
elif ev[0] == 'REG_MESSAGE':
for msg in ev[2]:
self.hub.register(ev[1], msg)
else:
log.debug(_("Unknown Command %s") % ev[0])
else:
......@@ -522,25 +526,6 @@ def loadPlugins(gc):
for mod in mods:
modObj = gc.hub.newPlugin(mod)
gc.hub.register(mod, 'ROSTER')
gc.hub.register(mod, 'WARNING')
gc.hub.register(mod, 'STATUS')
gc.hub.register(mod, 'NOTIFY')
gc.hub.register(mod, 'MSG')
gc.hub.register(mod, 'MSGERROR')
gc.hub.register(mod, 'MSGSENT')
gc.hub.register(mod, 'SUBSCRIBED')
gc.hub.register(mod, 'UNSUBSCRIBED')
gc.hub.register(mod, 'SUBSCRIBE')
gc.hub.register(mod, 'AGENTS')
gc.hub.register(mod, 'AGENT_INFO')
gc.hub.register(mod, 'QUIT')
gc.hub.register(mod, 'ACC_OK')
gc.hub.register(mod, 'CONFIG')
gc.hub.register(mod, 'MYVCARD')
gc.hub.register(mod, 'VCARD')
gc.hub.register(mod, 'LOG_NB_LINE')
gc.hub.register(mod, 'LOG_LINE')
modObj.load()
# END loadPLugins
......
......@@ -1763,6 +1763,10 @@ class plugin:
gtk.threads_enter()
self.queueIN = quIN
self.queueOUT = quOUT
self.send('REG_MESSAGE', 'gtkgui', ['ROSTER', 'WARNING', 'STATUS', \
'NOTIFY', 'MSG', 'MSGERROR', 'SUBSCRIBED', 'UNSUBSCRIBED', \
'SUBSCRIBE', 'AGENTS', 'AGENT_INFO', 'QUIT', 'ACC_OK', 'CONFIG', \
'MYVCARD', 'VCARD', 'LOG_NB_LINE', 'LOG_LINE'])
self.send('ASK_CONFIG', None, ('GtkGui', 'GtkGui', {'autopopup':1,\
'autopopupaway':1,\
'showoffline':0,\
......
......@@ -86,6 +86,8 @@ class plugin:
def __init__(self, quIN, quOUT):
self.queueIN = quIN
self.queueOUT = quOUT
quOUT.put(('REG_MESSAGE', 'logger', ['CONFIG', 'NOTIFY', 'MSG', \
'MSGSENT', 'QUIT']))
quOUT.put(('ASK_CONFIG', None, ('Logger', 'Logger', {\
'lognotsep':1, 'lognotusr':1})))
self.config = self.wait('CONFIG')
......
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