summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks
diff options
context:
space:
mode:
authorGravatar Jeix <devnull@localhost> 2010-08-12 15:56:12 +0200
committerGravatar Jeix <devnull@localhost> 2010-08-12 15:56:12 +0200
commitf0ef72d9754bb11d23a3064fcf0a17add7d850ef (patch)
tree0030bedc378e36ccf9542aec68d6e7606ad11422 /module/plugins/hooks
parentIRC-Hook: respond fix (diff)
downloadpyload-f0ef72d9754bb11d23a3064fcf0a17add7d850ef.tar.xz
IRCHook fixes: getestet ! :D
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r--module/plugins/hooks/IRCInterface.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py
index c2faa905a..7628d77ea 100644
--- a/module/plugins/hooks/IRCInterface.py
+++ b/module/plugins/hooks/IRCInterface.py
@@ -77,14 +77,15 @@ class IRCInterface(Thread, Hook):
def run(self):
# connect to IRC etc.
self.sock = socket.socket()
- self.sock.connect((self.getConf("host"), self.getConf("port")))
- nick = self.getConf("nick")
+ host = self.getConfig("host")
+ self.sock.connect((host, self.getConfig("port")))
+ nick = self.getConfig("nick")
self.sock.send("NICK %s\r\n" % nick)
- self.sock.send("USER %s %s bla :%s\r\n" % (nick, self.getConf("host"), nick))
- for t in self.getConf("owner").split():
+ self.sock.send("USER %s %s bla :%s\r\n" % (nick, host, nick))
+ for t in self.getConfig("owner").split():
if t.strip().startswith("#"):
self.sock.send("JOIN %s\r\n" % t.strip())
- self.log.info("pyLoadIRC: Connected to %s!" % self.host)
+ self.log.info("pyLoadIRC: Connected to %s!" % host)
self.log.info("pyLoadIRC: Switching to listening mode!")
try:
self.main_loop()
@@ -135,10 +136,10 @@ class IRCInterface(Thread, Hook):
def handle_events(self, msg):
- if msg["origin"].split("!", 1)[0] != self.owner:
+ if not msg["origin"].split("!", 1)[0] in self.getConfig("owner").split():
return
- if msg["target"].split("!", 1)[0] != self.nick:
+ if msg["target"].split("!", 1)[0] != self.getConfig("nick"):
return
if msg["action"] != "PRIVMSG":
@@ -176,7 +177,7 @@ class IRCInterface(Thread, Hook):
def response(self, msg, origin=""):
if origin == "":
- for t in self.getConf("owner").split():
+ for t in self.getConfig("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))