Escape % in hostnames
[quassel.git] / src / uisupport / uistyle.cpp
index 41c50a6..b74e1b7 100644 (file)
@@ -552,6 +552,7 @@ void UiStyle::StyledMessage::style() const {
   QString txt = UiStyle::mircToInternal(contents());
   QString bufferName = bufferInfo().bufferName();
   bufferName.replace('%', "%%"); // well, you _can_ have a % in a buffername apparently... -_-
+  host.replace('%', "%%");       // hostnames too...
   const int maxNetsplitNicks = 15;
 
   QString t;
@@ -616,7 +617,7 @@ void UiStyle::StyledMessage::style() const {
       //: Topic Message
       t = tr("%1").arg(txt); break;
     case Message::NetsplitJoin: {
-      QStringList users = txt.split(":");
+      QStringList users = txt.split("#:#");
       QStringList servers = users.takeLast().split(" ");
 
       for(int i = 0; i < users.count() && i < maxNetsplitNicks; i++)
@@ -630,7 +631,7 @@ void UiStyle::StyledMessage::style() const {
       }
       break;
     case Message::NetsplitQuit: {
-      QStringList users = txt.split(":");
+      QStringList users = txt.split("#:#");
       QStringList servers = users.takeLast().split(" ");
 
       for(int i = 0; i < users.count() && i < maxNetsplitNicks; i++)