Nick sorting function type

master
const an teen 2021-12-17 12:07:19 -05:00
parent fcb58fc924
commit a7e3b99298
2 changed files with 8 additions and 5 deletions

View File

@ -288,7 +288,8 @@ void HttpServer::ircUsersOnline(QString server, QString channel, QStringList use
}
else if (rawOneNick.startsWith('+')) {
voicedNicks.push_back(rawOneNick);
} else {
}
else {
plainNicks.push_back(rawOneNick);
}
}
@ -309,7 +310,7 @@ void HttpServer::ircUsersOnline(QString server, QString channel, QStringList use
sortedNicknames += adminNicks;
}
if (not voicedNicks.isEmpty()) {
std::sort(adminNicks.begin(), voicedNicks.end());
std::sort(voicedNicks.begin(), voicedNicks.end());
sortedNicknames += voicedNicks;
}
if (not plainNicks.isEmpty()) {

View File

@ -457,9 +457,11 @@ void IrcClient::process(const QString &message)
'@' /*operator*/, '%' /*half-op*/,
'+' /*voiced*/};
for (auto &ch: m_online) {
ch.second.removeAll(nickname);
for (const auto& p: prefixes) {
ch.second.removeAll(p+nickname);
int removed = ch.second.removeAll(nickname);
if (removed == 0) {
for (const auto& p: prefixes) {
ch.second.removeAll(p+nickname);
}
}
emit userOnline(m_connectionData.displayName, ch.first, ch.second);
}