diff options
author | Jeix <devnull@localhost> | 2010-08-12 15:44:29 +0200 |
---|---|---|
committer | Jeix <devnull@localhost> | 2010-08-12 15:44:29 +0200 |
commit | 46ed833525acea23fcdb6a571b6c384dec996b41 (patch) | |
tree | c6e6096fcfdd792876a05681765342476a732c1d /module/plugins/hooks | |
parent | IRCHook extended for multiple owners and dynamic configuration (diff) | |
download | pyload-46ed833525acea23fcdb6a571b6c384dec996b41.tar.xz |
IRC-Hook: respond fix
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r-- | module/plugins/hooks/IRCInterface.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index e484f4426..c2faa905a 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -169,14 +169,17 @@ class IRCInterface(Thread, Hook): try: res = handler(args) for line in res: - self.response(line) + self.response(line, msg["origin"]) except Exception, e: self.log.error("pyLoadIRC: "+ repr(e)) - def response(self, msg): - for t in self.getConf("owner").split(): - self.sock.send("PRIVMSG %s :%s\r\n" % (t.strip(), msg)) + def response(self, msg, origin=""): + if origin == "": + for t in self.getConf("owner").split(): + self.sock.send("PRIVMSG %s :%s\r\n" % (t.strip(), msg)) + else: + self.sock.send("PRIVMSG %s :%s\r\n" % (origin.split("!", 1)[0], msg)) #### Events |