Blob Blame History Raw
diff -ru konversation-old/konversation/src/konvdcop.cpp konversation-new/konversation/src/konvdcop.cpp
--- konversation-old/konversation/src/konvdcop.cpp	2006-10-06 18:43:29.000000000 +0200
+++ konversation-new/konversation/src/konvdcop.cpp	2008-04-09 17:36:38.000000000 +0200
@@ -82,15 +82,23 @@
     emit dcopMultiServerRaw("me " + message);
 }
 
-void KonvDCOP::say(const QString& server,const QString& target,const QString& command)
+void KonvDCOP::say(const QString& _server,const QString& _target,const QString& _command)
 {
+    //Sadly, copy on write doesn't exist with QString::replace
+    QString server(_server), target(_target), command(_command);
+
     // TODO: this just masks a greater problem - Server::addQuery will return a query for '' --argonel
     // TODO: other DCOP calls need argument checking too --argonel
     if (server.isEmpty() || target.isEmpty() || command.isEmpty())
         kdDebug() <<  "KonvDCOP::say() requires 3 arguments." << endl;
     else
     {
-        kdDebug() << "KonvDCOP::say()" << endl;
+        command.replace('\n',"\\n");
+        command.replace('\r',"\\r");
+        target.remove('\n');
+        target.remove('\r');
+        server.remove('\n');
+        server.remove('\r');
         // Act as if the user typed it
         emit dcopSay(server,target,command);
     }