diff options
Diffstat (limited to 'IrcConnection.py')
-rw-r--r-- | IrcConnection.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/IrcConnection.py b/IrcConnection.py index 2df5913..7345f6d 100644 --- a/IrcConnection.py +++ b/IrcConnection.py @@ -5,9 +5,9 @@ import IrcHandler class ircConnectThread(QThread): sig = pyqtSignal(str, str, str) - nick_sig = pyqtSignal(str, str) + join_sig = pyqtSignal(str, str) part_sig = pyqtSignal(str, str) - join_sig = pyqtSignal(str) + nick_sig = pyqtSignal(str, str) topic_sig = pyqtSignal(str, str) namreply_sig = pyqtSignal(str, str) quit_sig = pyqtSignal(str, str) @@ -44,12 +44,13 @@ class ircConnectThread(QThread): self.c.add_global_handler("currenttopic", self.on_cur_topic) self.c.add_global_handler("topic", self.on_topic) self.c.add_global_handler("topicinfo", self.on_topic) + self.c.add_global_handler("nick", self.on_nick) self.c.add_global_handler("motd", self.on_motd) self.reactor.process_forever() def on_connect(self, connection, event): if irc.client.is_channel("#wtest"): - self.join_sig.emit("#wtest") + # self.join_sig.emit("#wtest") return def on_pubmsg(self, connection, event): print(event) @@ -61,7 +62,7 @@ class ircConnectThread(QThread): def on_join(self, connection, event): print(event) nick = event.source.split("!")[0] - self.nick_sig.emit(event.target, event.source.split("!")[0]) + self.join_sig.emit(event.target, event.source.split("!")[0]) def on_part(self, connection, event): nick = event.source.split("!")[0] @@ -102,6 +103,11 @@ class ircConnectThread(QThread): self.topic_sig.emit(event.target, event.arguments[0]) print(event) + def on_nick(self, connection, event): + source_nick = event.source.split("!")[0] + self.nick_sig.emit(source_nick, event.target) + print(event) + def on_motd(self, connection, event): print(event) |