summaryrefslogtreecommitdiff
path: root/IrcHandler.py
diff options
context:
space:
mode:
Diffstat (limited to 'IrcHandler.py')
-rw-r--r--IrcHandler.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/IrcHandler.py b/IrcHandler.py
index f0f14a9..7d87ac5 100644
--- a/IrcHandler.py
+++ b/IrcHandler.py
@@ -145,6 +145,40 @@ class IrcHandler(QObject):
channel.set_topic(topic)
self.window.update_topic(channel, topic)
+ def handle_user_mode(self, channelStr, target_user, mode, source_user):
+ if (channelStr in self.channels):
+ channel = self.channels.get(channelStr)
+ user_list = channel.get_view().findChild(QQuickItem, "nick_list")
+ chat_area = channel.get_view().findChild(QQuickItem, "chat_area")
+ if (mode == "+v"):
+ mode_char = "+"
+ mode_chat_str = " gave voice to "
+ elif (mode == "+h"):
+ mode_char = "%"
+ mode_chat_str = " gave half-ops to "
+ elif (mode == "+o"):
+ mode_char = "@"
+ mode_chat_str = " gave ops to "
+ elif (mode == "+a"):
+ mode_char = "&"
+ mode_chat_str = " gave owner status to "
+ elif (mode == "-v"):
+ mode_char = ""
+ mode_chat_str = " removed voice from "
+ elif (mode == "-h"):
+ mode_char = ""
+ mode_chat_str = " removed half-ops from "
+ elif (mode == "-o"):
+ mode_char = ""
+ mode_chat_str = " removed ops from "
+ elif (mode == "-a"):
+ mode_char = ""
+ mode_chat_str = " removed owner status from "
+
+ user_list.update_mode(target_user, mode_char)
+ channel.get_users()[target_user].set_mode(mode)
+ chat_area.append(source_user + mode_chat_str + target_user)
+
def connect_to_irc(self, view):
self.irc.sig.connect(self.handle_msg)
self.irc.join_sig.connect(self.join_channel)
@@ -154,6 +188,7 @@ class IrcHandler(QObject):
self.irc.quit_sig.connect(self.handle_quit)
self.irc.kick_sig.connect(self.handle_kick)
self.irc.topic_sig.connect(self.handle_topic)
+ self.irc.user_mode_sig.connect(self.handle_user_mode)
# self.irc.join_sig.connect(self.join_channel)
self.irc.start()
self.sig.connect(self.irc.send_msg)