mirror of https://notabug.org/acetone/ircabot.git
left menu links with current date
parent
a07b95fe92
commit
b5c5dce78b
|
@ -266,6 +266,16 @@ void HttpServer::writeMainPage(QTcpSocket *socket, QString &urlPath)
|
||||||
QString channelNameForUrl {c.first};
|
QString channelNameForUrl {c.first};
|
||||||
channelNameForUrl.remove('#');
|
channelNameForUrl.remove('#');
|
||||||
QString channelLink = "/" + global::toLowerAndNoSpaces(s.first) + "/" + channelNameForUrl;
|
QString channelLink = "/" + global::toLowerAndNoSpaces(s.first) + "/" + channelNameForUrl;
|
||||||
|
if (not year.isEmpty()) {
|
||||||
|
channelLink += "/" + year;
|
||||||
|
if (not month.isEmpty()) {
|
||||||
|
channelLink += "/" + month;
|
||||||
|
if (not day.isEmpty()) {
|
||||||
|
channelLink += "/" + day;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
replaceTag(htmlChannelLine, "CHANNEL_LINK", channelLink);
|
replaceTag(htmlChannelLine, "CHANNEL_LINK", channelLink);
|
||||||
|
|
||||||
htmlChannelLineS += htmlChannelLine;
|
htmlChannelLineS += htmlChannelLine;
|
||||||
|
@ -622,10 +632,8 @@ void HttpServer::writeMainPage(QTcpSocket *socket, QString &urlPath)
|
||||||
|
|
||||||
QString text {buffer};
|
QString text {buffer};
|
||||||
text.remove(QRegularExpression("^\\[.*\\]\\s"));
|
text.remove(QRegularExpression("^\\[.*\\]\\s"));
|
||||||
if (text.size() < 30) {
|
|
||||||
text.replace(' ', " "); // for long spaces (code examples, etc)
|
while (QRegularExpression("[^\\s]{100,10000}.*").match(text).hasMatch()) {
|
||||||
} else {
|
|
||||||
while (QRegularExpression("[^\\s]{50,10000}.*").match(text).hasMatch()) {
|
|
||||||
int pos = text.indexOf(QRegularExpression("[^\\s]{50,10000}.*"));
|
int pos = text.indexOf(QRegularExpression("[^\\s]{50,10000}.*"));
|
||||||
if (pos == -1) {
|
if (pos == -1) {
|
||||||
consoleLog("Bug! HttpServer.cpp while (QRegularExpression(\"[^\\s]{50,10000}.*\").match(text).hasMatch())");
|
consoleLog("Bug! HttpServer.cpp while (QRegularExpression(\"[^\\s]{50,10000}.*\").match(text).hasMatch())");
|
||||||
|
@ -633,7 +641,6 @@ void HttpServer::writeMainPage(QTcpSocket *socket, QString &urlPath)
|
||||||
}
|
}
|
||||||
text.insert(pos+25, ' ');
|
text.insert(pos+25, ' ');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (text.isEmpty()) continue;
|
if (text.isEmpty()) continue;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue