mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Fix story mention text updating.
This commit is contained in:
@@ -412,7 +412,7 @@ FullStoryId Media::storyId() const {
|
||||
return {};
|
||||
}
|
||||
|
||||
bool Media::storyExpired() const {
|
||||
bool Media::storyExpired(bool revalidate) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2033,7 +2033,15 @@ FullStoryId MediaStory::storyId() const {
|
||||
return _storyId;
|
||||
}
|
||||
|
||||
bool MediaStory::storyExpired() const {
|
||||
bool MediaStory::storyExpired(bool revalidate) {
|
||||
if (revalidate) {
|
||||
const auto stories = &parent()->history()->owner().stories();
|
||||
if (const auto maybeStory = stories->lookup(_storyId)) {
|
||||
_expired = false;
|
||||
} else if (maybeStory.error() == Data::NoStory::Deleted) {
|
||||
_expired = true;
|
||||
}
|
||||
}
|
||||
return _expired;
|
||||
}
|
||||
|
||||
|
@@ -114,7 +114,7 @@ public:
|
||||
virtual PollData *poll() const;
|
||||
virtual const WallPaper *paper() const;
|
||||
virtual FullStoryId storyId() const;
|
||||
virtual bool storyExpired() const;
|
||||
virtual bool storyExpired(bool revalidate = false);
|
||||
virtual bool storyMention() const;
|
||||
|
||||
virtual bool uploading() const;
|
||||
@@ -580,7 +580,7 @@ public:
|
||||
std::unique_ptr<Media> clone(not_null<HistoryItem*> parent) override;
|
||||
|
||||
FullStoryId storyId() const override;
|
||||
bool storyExpired() const override;
|
||||
bool storyExpired(bool revalidate = false) override;
|
||||
bool storyMention() const override;
|
||||
|
||||
TextWithEntities notificationText() const override;
|
||||
|
@@ -3917,6 +3917,11 @@ void Session::refreshStoryItemViews(FullStoryId id) {
|
||||
const auto i = _storyItems.find(id);
|
||||
if (i != _storyItems.end()) {
|
||||
for (const auto item : i->second) {
|
||||
if (const auto media = item->media()) {
|
||||
if (media->storyMention()) {
|
||||
item->updateStoryMentionText();
|
||||
}
|
||||
}
|
||||
requestItemViewRefresh(item);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user