mirror of https://notabug.org/acetone/ircabot.git
blinded message opacity 0.5
parent
96819fd3ce
commit
42c72838f6
1
global.h
1
global.h
|
@ -7,6 +7,7 @@ class QString;
|
|||
|
||||
namespace global
|
||||
{
|
||||
const QString BLINDED_MESSAGE_MERKER = "Blinded message";
|
||||
#ifdef WIN32
|
||||
const char slash = '\\';
|
||||
#else
|
||||
|
|
|
@ -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\">");
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue