mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-05 00:46:08 +00:00
Track stories deletion and refresh views.
This commit is contained in:
@@ -3881,6 +3881,33 @@ void Session::destroyAllCallItems() {
|
||||
}
|
||||
}
|
||||
|
||||
void Session::registerStoryItem(
|
||||
FullStoryId id,
|
||||
not_null<HistoryItem*> item) {
|
||||
_storyItems[id].emplace(item);
|
||||
}
|
||||
|
||||
void Session::unregisterStoryItem(
|
||||
FullStoryId id,
|
||||
not_null<HistoryItem*> item) {
|
||||
const auto i = _storyItems.find(id);
|
||||
if (i != _storyItems.end()) {
|
||||
auto &items = i->second;
|
||||
if (items.remove(item) && items.empty()) {
|
||||
_storyItems.erase(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Session::refreshStoryItemViews(FullStoryId id) {
|
||||
const auto i = _storyItems.find(id);
|
||||
if (i != _storyItems.end()) {
|
||||
for (const auto item : i->second) {
|
||||
requestItemViewRefresh(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Session::documentMessageRemoved(not_null<DocumentData*> document) {
|
||||
if (_documentItems.find(document) != _documentItems.end()) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user