summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Jeix <devnull@localhost> 2010-08-12 15:44:29 +0200
committerGravatar Jeix <devnull@localhost> 2010-08-12 15:44:29 +0200
commit46ed833525acea23fcdb6a571b6c384dec996b41 (patch)
treec6e6096fcfdd792876a05681765342476a732c1d
parentIRCHook extended for multiple owners and dynamic configuration (diff)
downloadpyload-46ed833525acea23fcdb6a571b6c384dec996b41.tar.xz
IRC-Hook: respond fix
-rw-r--r--module/plugins/hooks/IRCInterface.py11
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