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

Added search to files and links shared media.

This commit is contained in:
John Preston
2017-10-30 23:24:20 +04:00
parent a27edcad1c
commit eb2719fad1
25 changed files with 1110 additions and 220 deletions

View File

@@ -2038,7 +2038,7 @@ void History::getReadyFor(MsgId msgId) {
return;
}
if (msgId == ShowAtUnreadMsgId && peer->migrateFrom()) {
if (History *h = App::historyLoaded(peer->migrateFrom()->id)) {
if (auto h = App::historyLoaded(peer->migrateFrom()->id)) {
if (h->unreadCount()) {
clear(true);
h->getReadyFor(msgId);
@@ -2217,7 +2217,9 @@ void History::clear(bool leaveItems) {
if (scrollTopItem) {
forgetScrollState();
}
if (!leaveItems) {
if (leaveItems) {
Auth().data().markHistoryUnloaded(this);
} else {
setLastMessage(nullptr);
notifies.clear();
auto &pending = Global::RefPendingRepaintItems();
@@ -2238,6 +2240,7 @@ void History::clear(bool leaveItems) {
}
}
Auth().storage().remove(Storage::SharedMediaRemoveAll(peer->id));
Auth().data().markHistoryCleared(this);
}
clearBlocks(leaveItems);
if (leaveItems) {
@@ -2263,9 +2266,6 @@ void History::clear(bool leaveItems) {
peer->asChannel()->mgInfo->markupSenders.clear();
}
}
if (leaveItems) {
Auth().data().historyCleared().notify(this, true);
}
}
void History::clearBlocks(bool leaveItems) {