mirror of https://notabug.org/acetone/ircabot.git
online counter fix (op/owners/etc nick reading)
parent
9056f209f4
commit
fba0afb3df
|
@ -548,8 +548,10 @@ void HttpServer::writeMainPage(QTcpSocket *socket, QString &urlPath, bool isHead
|
||||||
replaceTag(page, "ONLINE", QString::number(currentOnline));
|
replaceTag(page, "ONLINE", QString::number(currentOnline));
|
||||||
|
|
||||||
QString onlineUserS;
|
QString onlineUserS;
|
||||||
|
std::sort(m_onlineUsers[originalServerName][originalChannelName].begin(),
|
||||||
|
m_onlineUsers[originalServerName][originalChannelName].end());
|
||||||
for (const auto &user: m_onlineUsers[originalServerName][originalChannelName]) {
|
for (const auto &user: m_onlineUsers[originalServerName][originalChannelName]) {
|
||||||
if (QRegularExpression("^.?"+m_botsNick[originalServerName]+"$").match(user).hasMatch()) {
|
if (QRegularExpression("^(@|\\&|\\+|~)?"+m_botsNick[originalServerName]+"$").match(user).hasMatch()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
QString onlineUser = HTML_ONLINE_POINT;
|
QString onlineUser = HTML_ONLINE_POINT;
|
||||||
|
|
|
@ -450,8 +450,13 @@ void IrcClient::process(const QString &message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_rgxQuit.match(message).hasMatch()) {
|
else if (m_rgxQuit.match(message).hasMatch()) {
|
||||||
|
const std::array<char, 4> prefixes {'~' /*admin*/, '@' /*operator*/,
|
||||||
|
'%' /*half-op*/, '+' /*voiced*/};
|
||||||
for (auto &ch: m_online) {
|
for (auto &ch: m_online) {
|
||||||
ch.second.removeAll(nickname);
|
ch.second.removeAll(nickname);
|
||||||
|
for (const auto& p: prefixes) {
|
||||||
|
ch.second.removeAll(p+nickname);
|
||||||
|
}
|
||||||
emit userOnline(m_connectionData.displayName, ch.first, ch.second);
|
emit userOnline(m_connectionData.displayName, ch.first, ch.second);
|
||||||
}
|
}
|
||||||
consoleLog("QUIT " + nickname);
|
consoleLog("QUIT " + nickname);
|
||||||
|
|
|
@ -42,7 +42,7 @@ private:
|
||||||
ConnectionData m_connectionData;
|
ConnectionData m_connectionData;
|
||||||
QTimer m_timerToJoin;
|
QTimer m_timerToJoin;
|
||||||
QTimer m_nickRecover;
|
QTimer m_nickRecover;
|
||||||
QTimer m_usersActualize; // really need it?
|
QTimer m_usersActualize; // to get all users status (op, owner, etc)
|
||||||
QTimer m_pingTimeout;
|
QTimer m_pingTimeout;
|
||||||
|
|
||||||
const QRegularExpression m_rgxPrivmsg {"^[^\\s]*\\sPRIVMSG"};
|
const QRegularExpression m_rgxPrivmsg {"^[^\\s]*\\sPRIVMSG"};
|
||||||
|
|
Loading…
Reference in New Issue