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};
|
||||
channelNameForUrl.remove('#');
|
||||
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);
|
||||
|
||||
htmlChannelLineS += htmlChannelLine;
|
||||
|
@ -622,17 +632,14 @@ void HttpServer::writeMainPage(QTcpSocket *socket, QString &urlPath)
|
|||
|
||||
QString text {buffer};
|
||||
text.remove(QRegularExpression("^\\[.*\\]\\s"));
|
||||
if (text.size() < 30) {
|
||||
text.replace(' ', " "); // for long spaces (code examples, etc)
|
||||
} else {
|
||||
while (QRegularExpression("[^\\s]{50,10000}.*").match(text).hasMatch()) {
|
||||
int pos = text.indexOf(QRegularExpression("[^\\s]{50,10000}.*"));
|
||||
if (pos == -1) {
|
||||
consoleLog("Bug! HttpServer.cpp while (QRegularExpression(\"[^\\s]{50,10000}.*\").match(text).hasMatch())");
|
||||
break;
|
||||
}
|
||||
text.insert(pos+25, ' ');
|
||||
|
||||
while (QRegularExpression("[^\\s]{100,10000}.*").match(text).hasMatch()) {
|
||||
int pos = text.indexOf(QRegularExpression("[^\\s]{50,10000}.*"));
|
||||
if (pos == -1) {
|
||||
consoleLog("Bug! HttpServer.cpp while (QRegularExpression(\"[^\\s]{50,10000}.*\").match(text).hasMatch())");
|
||||
break;
|
||||
}
|
||||
text.insert(pos+25, ' ');
|
||||
}
|
||||
|
||||
if (text.isEmpty()) continue;
|
||||
|
|
Loading…
Reference in New Issue