version 0.8.30.dev fixed commands list

This commit is contained in:
John Preston 2015-06-24 21:40:32 +03:00
parent 793a2ec90c
commit 3f6664c82a

View File

@ -2794,8 +2794,10 @@ void MentionsDropdown::updateFiltered(bool toDown) {
for (MentionRows::const_iterator i = _chat->lastAuthors.cbegin(), e = _chat->lastAuthors.cend(); i != e; ++i) { for (MentionRows::const_iterator i = _chat->lastAuthors.cbegin(), e = _chat->lastAuthors.cend(); i != e; ++i) {
UserData *user = *i; UserData *user = *i;
if (!user->botInfo) continue; if (!user->botInfo) continue;
if (!bots.contains(user)) continue;
if (!user->botInfo->inited) App::api()->requestFullPeer(user); if (!user->botInfo->inited) App::api()->requestFullPeer(user);
if (user->botInfo->commands.isEmpty()) continue; if (user->botInfo->commands.isEmpty()) continue;
bots.remove(user);
for (int32 j = 0, l = user->botInfo->commands.size(); j < l; ++j) { for (int32 j = 0, l = user->botInfo->commands.size(); j < l; ++j) {
if (_filter.size() > 1) { if (_filter.size() > 1) {
QString toFilter = (hasUsername || botStatus == 0 || botStatus == 2) ? user->botInfo->commands.at(j).command + '@' + user->username : user->botInfo->commands.at(j).command; QString toFilter = (hasUsername || botStatus == 0 || botStatus == 2) ? user->botInfo->commands.at(j).command + '@' + user->username : user->botInfo->commands.at(j).command;
@ -2803,9 +2805,6 @@ void MentionsDropdown::updateFiltered(bool toDown) {
} }
crows.push_back(qMakePair(user, user->botInfo->commands.at(j))); crows.push_back(qMakePair(user, user->botInfo->commands.at(j)));
} }
if (!bots.isEmpty()) {
bots.remove(user);
}
} }
} }
if (!bots.isEmpty()) { if (!bots.isEmpty()) {