personal messages enhancements: complex nicks are automatic formated
correctly with " " in the /msg command; also simple pm feedback for the sender added
This commit is contained in:
@@ -50,8 +50,11 @@ void ChatTools::sendMessage()
|
||||
if(chatText.indexOf(QString("/msg ")) == 0) {
|
||||
chatText.remove(0, 5);
|
||||
unsigned playerId = parsePrivateMessageTarget(chatText);
|
||||
if (playerId)
|
||||
if (playerId) {
|
||||
mySession->sendPrivateChatMessage(playerId, chatText.toUtf8().constData());
|
||||
QString tmp = tr("private message sent to player: %1");
|
||||
myTextBrowser->append("<i>"+tmp.arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerId).playerName.c_str()))+"</i>");
|
||||
}
|
||||
} else {
|
||||
mySession->sendLobbyChatMessage(chatText.toUtf8().constData());
|
||||
}
|
||||
@@ -243,10 +246,18 @@ void ChatTools::nickAutoCompletition()
|
||||
|
||||
// cout << nickAutoCompletitionCounter << "\n";
|
||||
|
||||
if(lastChatString == "")
|
||||
if(lastChatString == "") {
|
||||
myLineEdit->setText(lastMatchStringList.at(nickAutoCompletitionCounter)+": ");
|
||||
else
|
||||
myLineEdit->setText(lastChatString+" "+lastMatchStringList.at(nickAutoCompletitionCounter)+" ");
|
||||
}
|
||||
else {
|
||||
//check if lastChatString is pm-code
|
||||
if((lastChatString == "/msg" || lastChatString == "/msg ") && lastMatchStringList.at(nickAutoCompletitionCounter).contains(" ")) {
|
||||
myLineEdit->setText(lastChatString+" \""+lastMatchStringList.at(nickAutoCompletitionCounter)+"\" ");
|
||||
}
|
||||
else {
|
||||
myLineEdit->setText(lastChatString+" "+lastMatchStringList.at(nickAutoCompletitionCounter)+" ");
|
||||
}
|
||||
}
|
||||
|
||||
nickAutoCompletitionCounter++;
|
||||
}
|
||||
|
||||
@@ -1554,7 +1554,7 @@ p, li { white-space: pre-wrap; }
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QTabWidget" name="tabWidget_2">
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<attribute name="title">
|
||||
|
||||
Reference in New Issue
Block a user