QTfrontend/newnetclient.cpp
changeset 1378 1a391883261d
parent 1377 a9e768739345
child 1384 329d3308e2e3
--- a/QTfrontend/newnetclient.cpp	Sat Oct 18 13:53:58 2008 +0000
+++ b/QTfrontend/newnetclient.cpp	Sat Oct 18 17:01:34 2008 +0000
@@ -249,7 +249,7 @@
 			qWarning("Net: Empty CHAT_STRING message");
 			return;
 		}
-		emit chatStringFromNet(QString("%1: %2").arg(lst[1]).arg(lst[2]));
+		emit chatStringFromNet(formatChatMsg(lst[1], lst[2]));
 		return;
 	}
 
@@ -298,7 +298,7 @@
 					ConfigAsked();
 			}
 			emit nickAdded(lst[i]);
-			emit chatStringFromNet(QString(tr("* %1 joined")).arg(lst[i]));
+			emit chatStringFromNet(QString(tr("*** %1 joined")).arg(lst[i]));
 		}
 		return;
 	}
@@ -310,7 +310,7 @@
 			return;
 		}
 		emit nickRemoved(lst[1]);
-		emit chatStringFromNet(QString(tr("* %1 left")).arg(lst[1]));
+		emit chatStringFromNet(QString(tr("*** %1 left")).arg(lst[1]));
 		return;
 	}
 
@@ -492,7 +492,7 @@
 {
   if(str!="") {
     RawSendNet(QString("CHAT_STRING")+delimeter+str);
-    emit(chatStringFromMe(QString("%1: %2").arg(mynick).arg(str)));
+    emit(chatStringFromMe(formatChatMsg(mynick, str)));
   }
 }
 
@@ -516,3 +516,11 @@
 	netClientState = 3;
 	RawSendNet(QString("ROUNDFINISHED"));
 }
+
+QString HWNewNet::formatChatMsg(const QString & nick, const QString & msg)
+{
+	if(msg.left(4) == "/me ")
+		return QString("* %1 %2").arg(nick).arg(msg.mid(4));
+	else
+		return QString("%1: %2").arg(nick).arg(msg);
+}