mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Support story link previews.
This commit is contained in:
@@ -455,6 +455,17 @@ void Stories::apply(not_null<PeerData*> peer, const MTPUserStories *data) {
|
||||
}
|
||||
}
|
||||
|
||||
Story *Stories::applyFromWebpage(PeerId peerId, const MTPstoryItem &story) {
|
||||
const auto idDates = parseAndApply(
|
||||
_owner->peer(peerId),
|
||||
story,
|
||||
base::unixtime::now());
|
||||
const auto value = idDates
|
||||
? lookup({ peerId, idDates.id })
|
||||
: base::make_unexpected(NoStory::Deleted);
|
||||
return value ? value->get() : nullptr;
|
||||
}
|
||||
|
||||
void Stories::requestUserStories(not_null<UserData*> user) {
|
||||
if (!_requestingUserStories.emplace(user).second) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user