2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 09:05:14 +00:00

prepared 0.5.13 - greatly improved network support (bad_msg_notification handle, connecting notification, dc full config embed, getting config each launch, dc option notify handle, enum dc for new config

This commit is contained in:
John Preston
2014-08-01 22:49:43 +04:00
parent 0e031f042d
commit 5ce2e2b219
25 changed files with 266 additions and 76 deletions

View File

@@ -906,7 +906,6 @@ DialogsListWidget::SearchResults &DialogsListWidget::searchList() {
}
DialogsWidget::DialogsWidget(MainWidget *parent) : QWidget(parent)
, _configLoaded(false)
, _drawShadow(true)
, dlgOffset(0)
, dlgCount(-1)
@@ -1070,7 +1069,6 @@ void DialogsWidget::dialogsReceived(const MTPmessages_Dialogs &dialogs) {
}
} else {
dlgCount = dlgOffset;
loadConfig();
}
dlgPreloading = 0;
@@ -1137,19 +1135,9 @@ void DialogsWidget::onSearchMore(MsgId minMsgId) {
}
}
void DialogsWidget::loadConfig() {
if (!_configLoaded) {
mtpConfigLoader()->load();
_configLoaded = true;
}
}
void DialogsWidget::loadDialogs() {
if (dlgPreloading) return;
if (dlgCount >= 0 && dlgOffset >= dlgCount) {
loadConfig();
return;
}
if (dlgCount >= 0 && dlgOffset >= dlgCount) return;
int32 loadCount = dlgOffset ? DialogsPerPage : DialogsFirstLoad;
dlgPreloading = MTP::send(MTPmessages_GetDialogs(MTP_int(dlgOffset), MTP_int(0), MTP_int(loadCount)), rpcDone(&DialogsWidget::dialogsReceived), rpcFail(&DialogsWidget::dialogsFailed));