2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Start non-unique ChatTheme.

This commit is contained in:
John Preston
2021-08-26 16:25:48 +03:00
parent f3dd8c68b3
commit 3cd0f9d189
40 changed files with 954 additions and 599 deletions

View File

@@ -458,7 +458,7 @@ void History::unpinAllMessages() {
Storage::SharedMediaRemoveAll(
peer->id,
Storage::SharedMediaType::Pinned));
peer->setHasPinnedMessages(false);
setHasPinnedMessages(false);
for (const auto &message : _messages) {
if (message->isPinned()) {
message->setIsPinned(false);
@@ -751,7 +751,7 @@ not_null<HistoryItem*> History::addNewToBack(
item->id,
{ from, till }));
if (sharedMediaTypes.test(Storage::SharedMediaType::Pinned)) {
peer->setHasPinnedMessages(true);
setHasPinnedMessages(true);
}
}
}
@@ -1023,7 +1023,7 @@ void History::applyServiceChanges(
Storage::SharedMediaType::Pinned,
{ id },
{ id, ServerMaxMsgId }));
peer->setHasPinnedMessages(true);
setHasPinnedMessages(true);
}
});
}
@@ -1401,7 +1401,7 @@ void History::addToSharedMedia(
std::move(medias[i]),
{ from, till }));
if (type == Storage::SharedMediaType::Pinned) {
peer->setHasPinnedMessages(true);
setHasPinnedMessages(true);
}
}
}
@@ -3123,6 +3123,15 @@ void History::removeBlock(not_null<HistoryBlock*> block) {
}
}
bool History::hasPinnedMessages() const {
return _hasPinnedMessages;
}
void History::setHasPinnedMessages(bool has) {
_hasPinnedMessages = has;
session().changes().historyUpdated(this, UpdateFlag::PinnedMessages);
}
History::~History() = default;
HistoryBlock::HistoryBlock(not_null<History*> history)