2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

improved mentions dropdown, version 0.8.28.dev

This commit is contained in:
John Preston
2015-06-18 20:24:54 +03:00
parent 391b370b0f
commit 11384743bc
16 changed files with 179 additions and 78 deletions

View File

@@ -540,6 +540,8 @@ namespace App {
}
}
if (!chat->participants.isEmpty()) {
History *h = App::historyLoaded(chat->id);
bool found = !h || !h->lastKeyboardFrom;
int32 botStatus = -1;
for (ChatData::Participants::iterator i = chat->participants.begin(), e = chat->participants.end(); i != e;) {
if (i.value() < pversion) {
@@ -549,10 +551,18 @@ namespace App {
botStatus = (botStatus > 0/* || i.key()->botInfo->readsAllHistory*/) ? 2 : 1;
if (requestBotInfos && !i.key()->botInfo->inited) App::api()->requestFullPeer(i.key());
}
if (!found && i.key()->id == h->lastKeyboardFrom) {
found = true;
}
++i;
}
}
chat->botStatus = botStatus;
if (!found) {
h->lastKeyboardId = 0;
h->lastKeyboardFrom = 0;
if (App::main()) App::main()->updateBotKeyboard();
}
}
if (App::main()) App::main()->peerUpdated(chat);
}
@@ -604,6 +614,13 @@ namespace App {
if (i != chat->participants.end()) {
chat->participants.erase(i);
chat->count--;
History *h = App::historyLoaded(chat->id);
if (h && h->lastKeyboardFrom == user->id) {
h->lastKeyboardId = 0;
h->lastKeyboardFrom = 0;
if (App::main()) App::main()->updateBotKeyboard();
}
}
if (chat->botStatus > 0 && user->botInfo) {
int32 botStatus = -1;