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) {
|
if(chatText.indexOf(QString("/msg ")) == 0) {
|
||||||
chatText.remove(0, 5);
|
chatText.remove(0, 5);
|
||||||
unsigned playerId = parsePrivateMessageTarget(chatText);
|
unsigned playerId = parsePrivateMessageTarget(chatText);
|
||||||
if (playerId)
|
if (playerId) {
|
||||||
mySession->sendPrivateChatMessage(playerId, chatText.toUtf8().constData());
|
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 {
|
} else {
|
||||||
mySession->sendLobbyChatMessage(chatText.toUtf8().constData());
|
mySession->sendLobbyChatMessage(chatText.toUtf8().constData());
|
||||||
}
|
}
|
||||||
@@ -243,10 +246,18 @@ void ChatTools::nickAutoCompletition()
|
|||||||
|
|
||||||
// cout << nickAutoCompletitionCounter << "\n";
|
// cout << nickAutoCompletitionCounter << "\n";
|
||||||
|
|
||||||
if(lastChatString == "")
|
if(lastChatString == "") {
|
||||||
myLineEdit->setText(lastMatchStringList.at(nickAutoCompletitionCounter)+": ");
|
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++;
|
nickAutoCompletitionCounter++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1554,7 +1554,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<item row="2" column="0" colspan="2">
|
<item row="2" column="0" colspan="2">
|
||||||
<widget class="QTabWidget" name="tabWidget_2">
|
<widget class="QTabWidget" name="tabWidget_2">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab_2">
|
<widget class="QWidget" name="tab_2">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
|||||||
Reference in New Issue
Block a user