From 46ed833525acea23fcdb6a571b6c384dec996b41 Mon Sep 17 00:00:00 2001 From: Jeix Date: Thu, 12 Aug 2010 15:44:29 +0200 Subject: IRC-Hook: respond fix --- module/plugins/hooks/IRCInterface.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'module') 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 -- cgit v1.2.3