blinded message opacity 0.5

master
const an teen 2021-12-31 03:30:30 -05:00
parent 96819fd3ce
commit 42c72838f6
3 changed files with 22 additions and 1 deletions

View File

@ -7,6 +7,7 @@ class QString;
namespace global
{
const QString BLINDED_MESSAGE_MERKER = "Blinded message";
#ifdef WIN32
const char slash = '\\';
#else

View File

@ -770,6 +770,10 @@ void HttpServer::writeMainPage(QTcpSocket *socket, QString &urlPath, bool isHead
}
counter++;
QString message = HTML_PAYLOAD_LIST_CHAT_MESSAGE;
if (rawMessage.second == global::BLINDED_MESSAGE_MERKER) {
message.replace("class=\"main_payload__chat\"",
"class=\"main_payload__chat\" style=\"opacity: .5\"");
}
for (const auto &user: m_servers[originalServerName][originalChannelName]) {
if (QRegularExpression("^(.*;|~|@|\\&|\\+)?"+rawMessage.first+"$").match(user).hasMatch()) {
message.replace("<div class=\"main_payload__chat_username\">",
@ -827,6 +831,10 @@ void HttpServer::writeMainPage(QTcpSocket *socket, QString &urlPath, bool isHead
}
counter++;
QString message = HTML_PAYLOAD_LIST_CHAT_MESSAGE;
if (rawMessage.second == global::BLINDED_MESSAGE_MERKER) {
message.replace("class=\"main_payload__chat\"",
"class=\"main_payload__chat\" style=\"opacity: .5\"");
}
for (const auto &user: m_servers[originalServerName][originalChannelName]) {
if (QRegularExpression("^^(.*;|~|@|\\&|\\+)?"+rawMessage.first+"$").match(user).hasMatch()) {
message.replace("<div class=\"main_payload__chat_username\">",
@ -907,6 +915,10 @@ void HttpServer::writeMainPage(QTcpSocket *socket, QString &urlPath, bool isHead
}
counter++;
QString message = HTML_PAYLOAD_LIST_CHAT_MESSAGE;
if (rawMessage.second == global::BLINDED_MESSAGE_MERKER) {
message.replace("class=\"main_payload__chat\"",
"class=\"main_payload__chat\" style=\"opacity: .5\"");
}
for (const auto &user: m_servers[originalServerName][originalChannelName]) {
if (QRegularExpression("^^(.*;|~|@|\\&|\\+)?"+rawMessage.first+"$").match(user).hasMatch()) {
message.replace("<div class=\"main_payload__chat_username\">",
@ -1084,6 +1096,10 @@ void HttpServer::writeMainPage(QTcpSocket *socket, QString &urlPath, bool isHead
}
QString message = HTML_PAYLOAD_LIST_CHAT_MESSAGE;
if (rawMessage.second == global::BLINDED_MESSAGE_MERKER) {
message.replace("class=\"main_payload__chat\"",
"class=\"main_payload__chat\" style=\"opacity: .5\"");
}
for (const auto &user: m_servers[originalServerName][originalChannelName]) {
if (QRegularExpression("^(.*;|~|@|\\&|\\+)?"+rawMessage.first+"$").match(user).hasMatch()) {
message.replace("<div class=\"main_payload__chat_username\">",
@ -1304,6 +1320,10 @@ void HttpServer::writeRealTimeChatPage(QTcpSocket *socket, QString &urlPath, boo
}
QString message = HTML_PAYLOAD_LIST_CHAT_MESSAGE;
if (rawMessage.second == global::BLINDED_MESSAGE_MERKER) {
message.replace("class=\"main_payload__chat\"",
"class=\"main_payload__chat\" style=\"opacity: .5\"");
}
message.replace("<div class=\"main_payload__chat_username\">",
"<div class=\"main_payload__chat_username\" style=\"color: #e34f10\">");

View File

@ -418,7 +418,7 @@ void IrcClient::process(const QString &message)
userMsg.remove(QRegularExpression("^.*"+channel+"\\s:"));
if (userMsg.startsWith('.')) {
userMsg = "Blinded message";
userMsg = global::BLINDED_MESSAGE_MERKER;
}
else if (userMsg.startsWith("ACTION")) {
userMsg.remove("ACTION");