mirror of https://notabug.org/acetone/ircabot.git
nick colors in real time mode
parent
4b91d372c2
commit
0e03abdea4
|
@ -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");
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue