nick colors in real time mode

master
const an teen 2021-12-29 13:49:01 -05:00
parent 4b91d372c2
commit 0e03abdea4
2 changed files with 5 additions and 9 deletions

View File

@ -55,7 +55,7 @@ function toAJAX()
xhttp.onload = function() {
if (reqIsFailed) {
reqIsFailed = false;
objPath.removeAttribute("style", "color: red");
objPath.removeAttribute("style");
}
const answer = JSON.parse(xhttp.responseText);
@ -65,7 +65,7 @@ function toAJAX()
}
if (answer.serverStatusChanged) {
if (answer.serverStatus) {
objPath.removeAttribute("style", "color: red");
objPath.removeAttribute("style");
objCurrentServerStatus.innerText = HTML_SERVER_ONLINE_MARKER;
} else {
objPath.setAttribute("style", "color: red");

View File

@ -1299,13 +1299,9 @@ void HttpServer::writeRealTimeChatPage(QTcpSocket *socket, QString &urlPath, boo
}
QString message = HTML_PAYLOAD_LIST_CHAT_MESSAGE;
for (const auto &user: m_onlineUsers[originalServerName][originalChannelName]) {
if (QRegularExpression("^(.*;|~|@|\\&|\\+)?"+rawMessage.first+"$").match(user).hasMatch()) {
message.replace("<div class=\"main_payload__chat_username\">",
"<div class=\"main_payload__chat_username\" style=\"color: green\">");
break;
}
}
message.replace("<div class=\"main_payload__chat_username\">",
"<div class=\"main_payload__chat_username\" style=\"color: #e34f10\">");
replaceTag(message, "USERNAME", rawMessage.first);
replaceTag(message, "MESSAGE_TEXT", rawMessage.second);
payloadBlock += message;