mirror of https://notabug.org/acetone/ircabot.git
Nick sorting function type
parent
fcb58fc924
commit
a7e3b99298
|
@ -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()) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue