2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

version 0.8.10.dev with fixes in webpage layout, history load and history msgs reg

This commit is contained in:
John Preston
2015-05-01 02:05:19 +03:00
parent 3fc74166de
commit c54aadcac3
10 changed files with 43 additions and 25 deletions

View File

@@ -1977,7 +1977,8 @@ void HistoryWidget::showPeer(const PeerId &peer, MsgId msgId, bool force, bool l
if (hist) {
if (histPeer->id == peer) {
if (msgId != hist->activeMsgId) {
if (!force && !hist->canShowAround(msgId)) {
bool canShowNow = hist->canShowAround(msgId);
if (!force && !canShowNow) {
if (_loadingAroundId != msgId) {
clearLoadingAround();
_loadingAroundId = msgId;
@@ -1986,9 +1987,13 @@ void HistoryWidget::showPeer(const PeerId &peer, MsgId msgId, bool force, bool l
return;
}
hist->loadAround(msgId);
if (histPreloading) MTP::cancel(histPreloading);
if (histPreloadingDown) MTP::cancel(histPreloadingDown);
histPreloading = histPreloadingDown = 0;
if (!canShowNow) {
histPreload.clear();
histPreloadDown.clear();
if (histPreloading) MTP::cancel(histPreloading);
if (histPreloadingDown) MTP::cancel(histPreloadingDown);
histPreloading = histPreloadingDown = 0;
}
}
if (_replyReturn && _replyReturn->id == msgId) calcNextReplyReturn();
@@ -2306,6 +2311,8 @@ bool HistoryWidget::messagesFailed(const RPCError &error, mtpRequestId requestId
void HistoryWidget::messagesReceived(const MTPmessages_Messages &messages, mtpRequestId requestId) {
if (!hist) {
histPreloading = histPreloadingDown = _loadingAroundRequest = 0;
histPreload.clear();
histPreloadDown.clear();
return;
}
@@ -2355,11 +2362,13 @@ void HistoryWidget::messagesReceived(const MTPmessages_Messages &messages, mtpRe
_loadingAroundRequest = 0;
hist->loadAround(_loadingAroundId);
if (hist->isEmpty()) {
histPreload.clear();
histPreloadDown.clear();
if (histPreloading) MTP::cancel(histPreloading);
if (histPreloadingDown) MTP::cancel(histPreloadingDown);
histPreloading = histPreloadingDown = 0;
addMessagesToFront(*histList);
}
if (histPreloading) MTP::cancel(histPreloading);
if (histPreloadingDown) MTP::cancel(histPreloadingDown);
histPreloading = histPreloadingDown = 0;
showPeer(hist->peer->id, _loadingAroundId, true);
}
return;