IrcChannelWidget: fixed an issue handling '/msg' with nickserv, chanserv and memoserv.

Tue, 21 Aug 2018 14:37:43 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 21 Aug 2018 14:37:43 +0200
changeset 6472
cb3809332396
parent 6471
ecfcfc58385c
child 6473
46d9adf29135

IrcChannelWidget: fixed an issue handling '/msg' with nickserv, chanserv and memoserv.

Network/IRC/IrcChannelWidget.py file | annotate | diff | comparison | revisions
diff -r ecfcfc58385c -r cb3809332396 Network/IRC/IrcChannelWidget.py
--- a/Network/IRC/IrcChannelWidget.py	Tue Aug 21 14:36:57 2018 +0200
+++ b/Network/IRC/IrcChannelWidget.py	Tue Aug 21 14:37:43 2018 +0200
@@ -234,6 +234,8 @@
         self.__markerLine = ""
         self.__hidden = True
         
+        self.__serviceNamesLower = ["nickserv", "chanserv", "memoserv"]
+        
         self.__patterns = [
             # :foo_!n=foo@foohost.bar.net PRIVMSG #eric-ide :some long message
             # :foo_!n=foo@foohost.bar.net PRIVMSG bar_ :some long message
@@ -365,12 +367,21 @@
                             """Messages starting with a '/' are not allowed"""
                             """ in private chats."""))
                 else:
-                    msgList = msg.split(None, 1)
+                    msgList = msg.split()
                     cmd = msgList[0][1:].upper()
                     if cmd == "MSG":
                         cmd = "PRIVMSG"
-                    msgList[0] = cmd
-                    self.sendData.emit(" ".join(msgList))
+                        if (len(msgList) > 1 and
+                            msgList[1].strip().lower() in
+                                self.__serviceNamesLower):
+                            msg = "PRIVMSG " + msgList[1].strip().lower() + \
+                                " :" + " ".join(msgList[2:])
+                        else:
+                            msgList[0] = cmd
+                            msg = " ".join(msgList)
+                    else:
+                        msg = msg[1:]
+                    self.sendData.emit(msg)
             else:
                 if self.__private:
                     self.sendData.emit(

eric ide

mercurial