summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-12-23 23:48:39 +0100
committermathieui <mathieui@mathieui.net>2014-12-23 23:48:39 +0100
commit668c1eb67741304278dfa05c68a7e1f33ae3181b (patch)
tree1c8e810c0461e9e101016e6fccec4742adde1b91 /plugins
parent3c195dd9ccef1adbb59ad8db7fcc7086fd01b667 (diff)
downloadpoezio-668c1eb67741304278dfa05c68a7e1f33ae3181b.tar.gz
poezio-668c1eb67741304278dfa05c68a7e1f33ae3181b.tar.bz2
poezio-668c1eb67741304278dfa05c68a7e1f33ae3181b.tar.xz
poezio-668c1eb67741304278dfa05c68a7e1f33ae3181b.zip
Fix the irc plugin
(and fuck the scoping of python closures)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/irc.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/irc.py b/plugins/irc.py
index ae51c297..300c48e5 100644
--- a/plugins/irc.py
+++ b/plugins/irc.py
@@ -171,14 +171,16 @@ class Plugin(BasePlugin):
login_nick = self.config.get_by_tabname('login_nick', section, default='')
nick = self.config.get_by_tabname('nickname', section, default='') or self.core.own_nick
if login_command and login_nick:
- def login():
- dest = '{}!{}'.format(login_nick, room_suffix[1:])
- self.core.xmpp.send_message(mto=dest, mbody=login_command, mtype='chat')
- delayed = self.api.create_delayed_event(5, self.join, gateway, section)
+ def login(gw, sect, log_nick, log_cmd, room_suff):
+ dest = '{}!{}'.format(log_nick, room_suff)
+ self.core.xmpp.send_message(mto=dest, mbody=log_cmd, mtype='chat')
+ delayed = self.api.create_delayed_event(5, self.join, gw, sect)
self.api.add_timed_event(delayed)
if not already_opened:
self.core.command_join(room_suffix + '/' + nick)
- delayed = self.api.create_delayed_event(3, login)
+ delayed = self.api.create_delayed_event(5, login, gateway, section,
+ login_nick, login_command,
+ room_suffix[1:])
self.api.add_timed_event(delayed)
else:
login()