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('+')) {
|
else if (rawOneNick.startsWith('+')) {
|
||||||
voicedNicks.push_back(rawOneNick);
|
voicedNicks.push_back(rawOneNick);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
plainNicks.push_back(rawOneNick);
|
plainNicks.push_back(rawOneNick);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -309,7 +310,7 @@ void HttpServer::ircUsersOnline(QString server, QString channel, QStringList use
|
||||||
sortedNicknames += adminNicks;
|
sortedNicknames += adminNicks;
|
||||||
}
|
}
|
||||||
if (not voicedNicks.isEmpty()) {
|
if (not voicedNicks.isEmpty()) {
|
||||||
std::sort(adminNicks.begin(), voicedNicks.end());
|
std::sort(voicedNicks.begin(), voicedNicks.end());
|
||||||
sortedNicknames += voicedNicks;
|
sortedNicknames += voicedNicks;
|
||||||
}
|
}
|
||||||
if (not plainNicks.isEmpty()) {
|
if (not plainNicks.isEmpty()) {
|
||||||
|
|
|
@ -457,9 +457,11 @@ void IrcClient::process(const QString &message)
|
||||||
'@' /*operator*/, '%' /*half-op*/,
|
'@' /*operator*/, '%' /*half-op*/,
|
||||||
'+' /*voiced*/};
|
'+' /*voiced*/};
|
||||||
for (auto &ch: m_online) {
|
for (auto &ch: m_online) {
|
||||||
ch.second.removeAll(nickname);
|
int removed = ch.second.removeAll(nickname);
|
||||||
for (const auto& p: prefixes) {
|
if (removed == 0) {
|
||||||
ch.second.removeAll(p+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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue