mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Handle documentLoadProgress instead of itemRepaintRequest.
This commit is contained in:
parent
1f38ab1690
commit
0192edbe84
11 changed files with 109 additions and 59 deletions
|
@ -369,6 +369,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_settings_section_general" = "General";
|
"lng_settings_section_general" = "General";
|
||||||
"lng_settings_change_lang" = "Change language";
|
"lng_settings_change_lang" = "Change language";
|
||||||
"lng_languages" = "Languages";
|
"lng_languages" = "Languages";
|
||||||
|
"lng_languages_none" = "No languages found.";
|
||||||
"lng_sure_save_language" = "Telegram will restart in order to change language";
|
"lng_sure_save_language" = "Telegram will restart in order to change language";
|
||||||
"lng_settings_update_automatically" = "Update automatically";
|
"lng_settings_update_automatically" = "Update automatically";
|
||||||
"lng_settings_install_beta" = "Install beta versions";
|
"lng_settings_install_beta" = "Install beta versions";
|
||||||
|
@ -1844,6 +1845,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_downloads_delete_sure_one" = "Do you want to delete this file?";
|
"lng_downloads_delete_sure_one" = "Do you want to delete this file?";
|
||||||
"lng_downloads_delete_sure#one" = "Do you want to delete {count} file?";
|
"lng_downloads_delete_sure#one" = "Do you want to delete {count} file?";
|
||||||
"lng_downloads_delete_sure#other" = "Do you want to delete {count} files?";
|
"lng_downloads_delete_sure#other" = "Do you want to delete {count} files?";
|
||||||
|
"lng_downloads_delete_in_cloud_one" = "It will be deleted from your disk, but will remain accessible in the cloud.";
|
||||||
|
"lng_downloads_delete_in_cloud" = "They will be deleted from your disk, but will remain accessible in the cloud.";
|
||||||
|
|
||||||
"lng_send_image_empty" = "Could not send an empty file: {name}";
|
"lng_send_image_empty" = "Could not send an empty file: {name}";
|
||||||
"lng_send_image_too_large" = "Could not send a file, because it is larger than 1500 MB: {name}";
|
"lng_send_image_too_large" = "Could not send a file, because it is larger than 1500 MB: {name}";
|
||||||
|
|
|
@ -167,7 +167,7 @@ LocalStorageBox::Row::Row(
|
||||||
sizeText(data),
|
sizeText(data),
|
||||||
st::localStorageRowSize)
|
st::localStorageRowSize)
|
||||||
, _clear(this, std::move(clear), st::localStorageClear) {
|
, _clear(this, std::move(clear), st::localStorageClear) {
|
||||||
_clear->setTextTransform(RoundButton::TextTransform::NoTransform);
|
_clear->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
|
||||||
_clear->setVisible(data.count != 0);
|
_clear->setVisible(data.count != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,10 @@ constexpr auto ByItem = [](const auto &entry) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
constexpr auto ByDocument = [](const auto &entry) {
|
||||||
|
return entry.object.document;
|
||||||
|
};
|
||||||
|
|
||||||
[[nodiscard]] uint64 PeerAccessHash(not_null<PeerData*> peer) {
|
[[nodiscard]] uint64 PeerAccessHash(not_null<PeerData*> peer) {
|
||||||
if (const auto user = peer->asUser()) {
|
if (const auto user = peer->asUser()) {
|
||||||
return user->accessHash();
|
return user->accessHash();
|
||||||
|
@ -66,11 +70,11 @@ void DownloadManager::trackSession(not_null<Main::Session*> session) {
|
||||||
data.downloaded = deserialize(session);
|
data.downloaded = deserialize(session);
|
||||||
data.resolveNeeded = data.downloaded.size();
|
data.resolveNeeded = data.downloaded.size();
|
||||||
|
|
||||||
session->data().itemRepaintRequest(
|
session->data().documentLoadProgress(
|
||||||
) | rpl::filter([=](not_null<const HistoryItem*> item) {
|
) | rpl::filter([=](not_null<DocumentData*> document) {
|
||||||
return _loading.contains(item);
|
return _loadingDocuments.contains(document);
|
||||||
}) | rpl::start_with_next([=](not_null<const HistoryItem*> item) {
|
}) | rpl::start_with_next([=](not_null<DocumentData*> document) {
|
||||||
check(item);
|
check(document);
|
||||||
}, data.lifetime);
|
}, data.lifetime);
|
||||||
|
|
||||||
session->data().itemLayoutChanged(
|
session->data().itemLayoutChanged(
|
||||||
|
@ -141,6 +145,7 @@ void DownloadManager::addLoading(DownloadObject object) {
|
||||||
.total = size,
|
.total = size,
|
||||||
});
|
});
|
||||||
_loading.emplace(item);
|
_loading.emplace(item);
|
||||||
|
_loadingDocuments.emplace(object.document);
|
||||||
_loadingProgress = DownloadProgress{
|
_loadingProgress = DownloadProgress{
|
||||||
.ready = _loadingProgress.current().ready,
|
.ready = _loadingProgress.current().ready,
|
||||||
.total = _loadingProgress.current().total + size,
|
.total = _loadingProgress.current().total + size,
|
||||||
|
@ -155,9 +160,25 @@ void DownloadManager::check(not_null<const HistoryItem*> item) {
|
||||||
auto &data = sessionData(item);
|
auto &data = sessionData(item);
|
||||||
const auto i = ranges::find(data.downloading, item, ByItem);
|
const auto i = ranges::find(data.downloading, item, ByItem);
|
||||||
Assert(i != end(data.downloading));
|
Assert(i != end(data.downloading));
|
||||||
|
check(data, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DownloadManager::check(not_null<DocumentData*> document) {
|
||||||
|
auto &data = sessionData(document);
|
||||||
|
const auto i = ranges::find(
|
||||||
|
data.downloading,
|
||||||
|
document.get(),
|
||||||
|
ByDocument);
|
||||||
|
Assert(i != end(data.downloading));
|
||||||
|
check(data, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DownloadManager::check(
|
||||||
|
SessionData &data,
|
||||||
|
std::vector<DownloadingId>::iterator i) {
|
||||||
auto &entry = *i;
|
auto &entry = *i;
|
||||||
|
|
||||||
const auto media = item->media();
|
const auto media = entry.object.item->media();
|
||||||
const auto photo = media ? media->photo() : nullptr;
|
const auto photo = media ? media->photo() : nullptr;
|
||||||
const auto document = media ? media->document() : nullptr;
|
const auto document = media ? media->document() : nullptr;
|
||||||
if (entry.object.photo != photo || entry.object.document != document) {
|
if (entry.object.photo != photo || entry.object.document != document) {
|
||||||
|
@ -169,7 +190,7 @@ void DownloadManager::check(not_null<const HistoryItem*> item) {
|
||||||
|
|
||||||
const auto path = document->filepath(true);
|
const auto path = document->filepath(true);
|
||||||
if (!path.isEmpty()) {
|
if (!path.isEmpty()) {
|
||||||
if (_loading.contains(item)) {
|
if (_loading.contains(entry.object.item)) {
|
||||||
addLoaded(entry.object, path, entry.started);
|
addLoaded(entry.object, path, entry.started);
|
||||||
}
|
}
|
||||||
} else if (!document->loading()) {
|
} else if (!document->loading()) {
|
||||||
|
@ -224,11 +245,14 @@ void DownloadManager::addLoaded(
|
||||||
const auto i = ranges::find(data.downloading, item, ByItem);
|
const auto i = ranges::find(data.downloading, item, ByItem);
|
||||||
if (i != end(data.downloading)) {
|
if (i != end(data.downloading)) {
|
||||||
auto &entry = *i;
|
auto &entry = *i;
|
||||||
|
const auto document = entry.object.document;
|
||||||
|
if (document) {
|
||||||
|
_loadingDocuments.remove(document);
|
||||||
|
}
|
||||||
const auto j = _loading.find(entry.object.item);
|
const auto j = _loading.find(entry.object.item);
|
||||||
if (j == end(_loading)) {
|
if (j == end(_loading)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const auto document = entry.object.document;
|
|
||||||
const auto totalChange = document->size - entry.total;
|
const auto totalChange = document->size - entry.total;
|
||||||
const auto readyChange = document->size - entry.ready;
|
const auto readyChange = document->size - entry.ready;
|
||||||
entry.ready += readyChange;
|
entry.ready += readyChange;
|
||||||
|
@ -531,6 +555,9 @@ void DownloadManager::remove(
|
||||||
};
|
};
|
||||||
_loading.remove(i->object.item);
|
_loading.remove(i->object.item);
|
||||||
_loadingDone.remove(i->object.item);
|
_loadingDone.remove(i->object.item);
|
||||||
|
if (const auto document = i->object.document) {
|
||||||
|
_loadingDocuments.remove(document);
|
||||||
|
}
|
||||||
data.downloading.erase(i);
|
data.downloading.erase(i);
|
||||||
_loadingListChanges.fire({});
|
_loadingListChanges.fire({});
|
||||||
_loadingProgress = now;
|
_loadingProgress = now;
|
||||||
|
@ -672,6 +699,11 @@ DownloadManager::SessionData &DownloadManager::sessionData(
|
||||||
return sessionData(&item->history()->session());
|
return sessionData(&item->history()->session());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DownloadManager::SessionData &DownloadManager::sessionData(
|
||||||
|
not_null<DocumentData*> document) {
|
||||||
|
return sessionData(&document->session());
|
||||||
|
}
|
||||||
|
|
||||||
void DownloadManager::writePostponed(not_null<Main::Session*> session) {
|
void DownloadManager::writePostponed(not_null<Main::Session*> session) {
|
||||||
session->account().local().updateDownloads(serializator(session));
|
session->account().local().updateDownloads(serializator(session));
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,6 +117,10 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
void check(not_null<const HistoryItem*> item);
|
void check(not_null<const HistoryItem*> item);
|
||||||
|
void check(not_null<DocumentData*> document);
|
||||||
|
void check(
|
||||||
|
SessionData &data,
|
||||||
|
std::vector<DownloadingId>::iterator i);
|
||||||
void changed(not_null<const HistoryItem*> item);
|
void changed(not_null<const HistoryItem*> item);
|
||||||
void removed(not_null<const HistoryItem*> item);
|
void removed(not_null<const HistoryItem*> item);
|
||||||
void detach(DownloadedId &id);
|
void detach(DownloadedId &id);
|
||||||
|
@ -134,6 +138,7 @@ private:
|
||||||
not_null<Main::Session*> session) const;
|
not_null<Main::Session*> session) const;
|
||||||
[[nodiscard]] SessionData &sessionData(
|
[[nodiscard]] SessionData &sessionData(
|
||||||
not_null<const HistoryItem*> item);
|
not_null<const HistoryItem*> item);
|
||||||
|
[[nodiscard]] SessionData &sessionData(not_null<DocumentData*> document);
|
||||||
|
|
||||||
void resolve(not_null<Main::Session*> session, SessionData &data);
|
void resolve(not_null<Main::Session*> session, SessionData &data);
|
||||||
void resolveRequestsFinished(
|
void resolveRequestsFinished(
|
||||||
|
@ -157,6 +162,7 @@ private:
|
||||||
|
|
||||||
base::flat_map<not_null<Main::Session*>, SessionData> _sessions;
|
base::flat_map<not_null<Main::Session*>, SessionData> _sessions;
|
||||||
base::flat_set<not_null<const HistoryItem*>> _loading;
|
base::flat_set<not_null<const HistoryItem*>> _loading;
|
||||||
|
base::flat_set<not_null<DocumentData*>> _loadingDocuments;
|
||||||
base::flat_set<not_null<const HistoryItem*>> _loadingDone;
|
base::flat_set<not_null<const HistoryItem*>> _loadingDone;
|
||||||
base::flat_set<not_null<const HistoryItem*>> _loaded;
|
base::flat_set<not_null<const HistoryItem*>> _loaded;
|
||||||
base::flat_set<not_null<HistoryItem*>> _generated;
|
base::flat_set<not_null<HistoryItem*>> _generated;
|
||||||
|
|
|
@ -1281,21 +1281,19 @@ void Session::requestPollViewRepaint(not_null<const PollData*> poll) {
|
||||||
|
|
||||||
void Session::documentLoadProgress(not_null<DocumentData*> document) {
|
void Session::documentLoadProgress(not_null<DocumentData*> document) {
|
||||||
requestDocumentViewRepaint(document);
|
requestDocumentViewRepaint(document);
|
||||||
session().documentUpdated.notify(document, true);
|
_documentLoadProgress.fire_copy(document);
|
||||||
|
|
||||||
if (document->isAudioFile()) {
|
|
||||||
::Media::Player::instance()->documentLoadProgress(document);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::documentLoadDone(not_null<DocumentData*> document) {
|
void Session::documentLoadDone(not_null<DocumentData*> document) {
|
||||||
notifyDocumentLayoutChanged(document);
|
notifyDocumentLayoutChanged(document);
|
||||||
|
_documentLoadProgress.fire_copy(document);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::documentLoadFail(
|
void Session::documentLoadFail(
|
||||||
not_null<DocumentData*> document,
|
not_null<DocumentData*> document,
|
||||||
bool started) {
|
bool started) {
|
||||||
notifyDocumentLayoutChanged(document);
|
notifyDocumentLayoutChanged(document);
|
||||||
|
_documentLoadProgress.fire_copy(document);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::photoLoadProgress(not_null<PhotoData*> photo) {
|
void Session::photoLoadProgress(not_null<PhotoData*> photo) {
|
||||||
|
|
|
@ -416,6 +416,11 @@ public:
|
||||||
void documentLoadDone(not_null<DocumentData*> document);
|
void documentLoadDone(not_null<DocumentData*> document);
|
||||||
void documentLoadFail(not_null<DocumentData*> document, bool started);
|
void documentLoadFail(not_null<DocumentData*> document, bool started);
|
||||||
|
|
||||||
|
[[nodiscard]] auto documentLoadProgress() const
|
||||||
|
-> rpl::producer<not_null<DocumentData*>> {
|
||||||
|
return _documentLoadProgress.events();
|
||||||
|
}
|
||||||
|
|
||||||
HistoryItem *addNewMessage(
|
HistoryItem *addNewMessage(
|
||||||
const MTPMessage &data,
|
const MTPMessage &data,
|
||||||
MessageFlags localFlags,
|
MessageFlags localFlags,
|
||||||
|
@ -930,6 +935,7 @@ private:
|
||||||
|
|
||||||
rpl::event_stream<not_null<WebPageData*>> _webpageUpdates;
|
rpl::event_stream<not_null<WebPageData*>> _webpageUpdates;
|
||||||
rpl::event_stream<not_null<ChannelData*>> _channelDifferenceTooLong;
|
rpl::event_stream<not_null<ChannelData*>> _channelDifferenceTooLong;
|
||||||
|
rpl::event_stream<not_null<DocumentData*>> _documentLoadProgress;
|
||||||
base::flat_set<not_null<ChannelData*>> _suggestToGigagroup;
|
base::flat_set<not_null<ChannelData*>> _suggestToGigagroup;
|
||||||
|
|
||||||
base::flat_multi_map<TimeId, not_null<PollData*>> _pollsClosings;
|
base::flat_multi_map<TimeId, not_null<PollData*>> _pollsClosings;
|
||||||
|
|
|
@ -167,11 +167,9 @@ public:
|
||||||
return _lifetime;
|
return _lifetime;
|
||||||
}
|
}
|
||||||
|
|
||||||
base::Observable<DocumentData*> documentUpdated;
|
[[nodiscard]] bool supportMode() const;
|
||||||
|
[[nodiscard]] Support::Helper &supportHelper() const;
|
||||||
bool supportMode() const;
|
[[nodiscard]] Support::Templates &supportTemplates() const;
|
||||||
Support::Helper &supportHelper() const;
|
|
||||||
Support::Templates &supportTemplates() const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr auto kDefaultSaveDelay = crl::time(1000);
|
static constexpr auto kDefaultSaveDelay = crl::time(1000);
|
||||||
|
|
|
@ -217,23 +217,27 @@ void Instance::setCurrent(const AudioMsgId &audioId) {
|
||||||
if (item) {
|
if (item) {
|
||||||
setHistory(data, item->history());
|
setHistory(data, item->history());
|
||||||
} else {
|
} else {
|
||||||
data->history = nullptr;
|
setHistory(
|
||||||
data->migrated = nullptr;
|
data,
|
||||||
data->session = nullptr;
|
nullptr,
|
||||||
|
audioId.audio() ? &audioId.audio()->session() : nullptr);
|
||||||
}
|
}
|
||||||
_trackChanged.fire_copy(data->type);
|
_trackChanged.fire_copy(data->type);
|
||||||
refreshPlaylist(data);
|
refreshPlaylist(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Instance::setHistory(not_null<Data*> data, History *history) {
|
void Instance::setHistory(
|
||||||
|
not_null<Data*> data,
|
||||||
|
History *history,
|
||||||
|
Main::Session *sessionFallback) {
|
||||||
if (history) {
|
if (history) {
|
||||||
data->history = history->migrateToOrMe();
|
data->history = history->migrateToOrMe();
|
||||||
data->migrated = data->history->migrateFrom();
|
data->migrated = data->history->migrateFrom();
|
||||||
setSession(data, &history->session());
|
setSession(data, &history->session());
|
||||||
} else {
|
} else {
|
||||||
data->history = data->migrated = nullptr;
|
data->history = data->migrated = nullptr;
|
||||||
setSession(data, nullptr);
|
setSession(data, sessionFallback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,6 +254,18 @@ void Instance::setSession(not_null<Data*> data, Main::Session *session) {
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=] {
|
||||||
setSession(data, nullptr);
|
setSession(data, nullptr);
|
||||||
}, data->sessionLifetime);
|
}, data->sessionLifetime);
|
||||||
|
|
||||||
|
session->data().documentLoadProgress(
|
||||||
|
) | rpl::filter([=](not_null<DocumentData*> document) {
|
||||||
|
// Before refactoring it was called only for audio files.
|
||||||
|
return document->isAudioFile();
|
||||||
|
}) | rpl::start_with_next([=](not_null<DocumentData*> document) {
|
||||||
|
const auto type = AudioMsgId::Type::Song;
|
||||||
|
emitUpdate(type, [&](const AudioMsgId &audioId) {
|
||||||
|
return (audioId.audio() == document);
|
||||||
|
});
|
||||||
|
}, data->sessionLifetime);
|
||||||
|
|
||||||
session->data().itemRemoved(
|
session->data().itemRemoved(
|
||||||
) | rpl::filter([=](not_null<const HistoryItem*> item) {
|
) | rpl::filter([=](not_null<const HistoryItem*> item) {
|
||||||
return (data->current.contextId() == item->fullId());
|
return (data->current.contextId() == item->fullId());
|
||||||
|
@ -1114,15 +1130,6 @@ void Instance::updateVoicePlaybackSpeed() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Instance::documentLoadProgress(DocumentData *document) {
|
|
||||||
const auto type = document->isAudioFile()
|
|
||||||
? AudioMsgId::Type::Song
|
|
||||||
: AudioMsgId::Type::Voice;
|
|
||||||
emitUpdate(type, [&](const AudioMsgId &audioId) {
|
|
||||||
return (audioId.audio() == document);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void Instance::emitUpdate(AudioMsgId::Type type) {
|
void Instance::emitUpdate(AudioMsgId::Type type) {
|
||||||
emitUpdate(type, [](const AudioMsgId &playing) { return true; });
|
emitUpdate(type, [](const AudioMsgId &playing) { return true; });
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,8 +165,6 @@ public:
|
||||||
|
|
||||||
[[nodiscard]] bool pauseGifByRoundVideo() const;
|
[[nodiscard]] bool pauseGifByRoundVideo() const;
|
||||||
|
|
||||||
void documentLoadProgress(DocumentData *document);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
using SharedMediaType = Storage::SharedMediaType;
|
using SharedMediaType = Storage::SharedMediaType;
|
||||||
using SliceKey = SparseIdsMergedSlice::Key;
|
using SliceKey = SparseIdsMergedSlice::Key;
|
||||||
|
@ -293,7 +291,10 @@ private:
|
||||||
void requestRoundVideoResize() const;
|
void requestRoundVideoResize() const;
|
||||||
void requestRoundVideoRepaint() const;
|
void requestRoundVideoRepaint() const;
|
||||||
|
|
||||||
void setHistory(not_null<Data*> data, History *history);
|
void setHistory(
|
||||||
|
not_null<Data*> data,
|
||||||
|
History *history,
|
||||||
|
Main::Session *sessionFallback = nullptr);
|
||||||
void setSession(not_null<Data*> data, Main::Session *session);
|
void setSession(not_null<Data*> data, Main::Session *session);
|
||||||
|
|
||||||
Data _songData;
|
Data _songData;
|
||||||
|
|
|
@ -679,23 +679,23 @@ void OverlayWidget::clearStreaming(bool savePosition) {
|
||||||
_streamed = nullptr;
|
_streamed = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverlayWidget::documentUpdated(DocumentData *doc) {
|
void OverlayWidget::documentUpdated(not_null<DocumentData*> document) {
|
||||||
if (_document && _document == doc) {
|
if (_document != document) {
|
||||||
if (documentBubbleShown()) {
|
return;
|
||||||
if ((_document->loading() && _docCancel->isHidden()) || (!_document->loading() && !_docCancel->isHidden())) {
|
} else if (documentBubbleShown()) {
|
||||||
updateControls();
|
if ((_document->loading() && _docCancel->isHidden()) || (!_document->loading() && !_docCancel->isHidden())) {
|
||||||
} else if (_document->loading()) {
|
updateControls();
|
||||||
updateDocSize();
|
} else if (_document->loading()) {
|
||||||
_widget->update(_docRect);
|
updateDocSize();
|
||||||
}
|
_widget->update(_docRect);
|
||||||
} else if (_streamed) {
|
|
||||||
const auto ready = _documentMedia->loaded()
|
|
||||||
? _document->size
|
|
||||||
: _document->loading()
|
|
||||||
? std::clamp(_document->loadOffset(), 0, _document->size)
|
|
||||||
: 0;
|
|
||||||
_streamed->controls.setLoadingProgress(ready, _document->size);
|
|
||||||
}
|
}
|
||||||
|
} else if (_streamed) {
|
||||||
|
const auto ready = _documentMedia->loaded()
|
||||||
|
? _document->size
|
||||||
|
: _document->loading()
|
||||||
|
? std::clamp(_document->loadOffset(), 0, _document->size)
|
||||||
|
: 0;
|
||||||
|
_streamed->controls.setLoadingProgress(ready, _document->size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4109,12 +4109,11 @@ void OverlayWidget::setSession(not_null<Main::Session*> session) {
|
||||||
}
|
}
|
||||||
}, _sessionLifetime);
|
}, _sessionLifetime);
|
||||||
|
|
||||||
base::ObservableViewer(
|
session->data().documentLoadProgress(
|
||||||
session->documentUpdated
|
) | rpl::filter([=] {
|
||||||
) | rpl::start_with_next([=](DocumentData *document) {
|
return !isHidden();
|
||||||
if (!isHidden()) {
|
}) | rpl::start_with_next([=](not_null<DocumentData*> document) {
|
||||||
documentUpdated(document);
|
documentUpdated(document);
|
||||||
}
|
|
||||||
}, _sessionLifetime);
|
}, _sessionLifetime);
|
||||||
|
|
||||||
session->data().itemIdChanged(
|
session->data().itemIdChanged(
|
||||||
|
|
|
@ -327,7 +327,7 @@ private:
|
||||||
void destroyThemePreview();
|
void destroyThemePreview();
|
||||||
void updateThemePreviewGeometry();
|
void updateThemePreviewGeometry();
|
||||||
|
|
||||||
void documentUpdated(DocumentData *doc);
|
void documentUpdated(not_null<DocumentData*> document);
|
||||||
void changingMsgId(not_null<HistoryItem*> row, MsgId oldId);
|
void changingMsgId(not_null<HistoryItem*> row, MsgId oldId);
|
||||||
|
|
||||||
[[nodiscard]] int finalContentRotation() const;
|
[[nodiscard]] int finalContentRotation() const;
|
||||||
|
|
Loading…
Add table
Reference in a new issue