added core config to jobs and tasks and made use of core variables raw in the tasks
This commit is contained in:
parent
25f83c3ae9
commit
0bfa4b3daa
5 changed files with 23 additions and 21 deletions
|
|
@ -17,10 +17,11 @@ class JabberTask(Task):
|
|||
self.set_task_type(kwargs["type"])
|
||||
self.recipient = kwargs["args"]["rcpt"]
|
||||
|
||||
def execute(self, msg):
|
||||
client = xmpp.Client('systemchaos.org')
|
||||
client.connect(server=('systemchaos.org', 5222))
|
||||
client.auth('linspector', 'PASSWORD', 'alert')
|
||||
def execute(self, msg, core):
|
||||
#TODO: totally unstable just to use values from core. make checks before...!
|
||||
client = xmpp.Client(core["tasks"]["jabber"]["host"])
|
||||
client.connect(server=(core["tasks"]["jabber"]["host"], core["tasks"]["jabber"]["port"]))
|
||||
client.auth(core["tasks"]["jabber"]["username"], core["tasks"]["jabber"]["password"], 'alert')
|
||||
client.sendInitPresence()
|
||||
message = xmpp.Message(self.recipient, msg)
|
||||
message.setAttr('type', 'chat')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue