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

Update API scheme. TODO public forwards stats.

This commit is contained in:
John Preston
2023-12-14 11:10:03 +00:00
parent 4337f0b509
commit f7e2c7977b
4 changed files with 49 additions and 8 deletions

View File

@@ -81,8 +81,11 @@ using UpdateFlag = StoryUpdate::Flag;
}, [](const MTPDgeoPointEmpty &) {
});
}, [&](const MTPDmediaAreaSuggestedReaction &data) {
}, [&](const MTPDmediaAreaChannelPost &data) {
}, [&](const MTPDinputMediaAreaChannelPost &data) {
LOG(("API Error: Unexpected inputMediaAreaChannelPost from API."));
}, [&](const MTPDinputMediaAreaVenue &data) {
LOG(("API Error: Unexpected inputMediaAreaVenue in API data."));
LOG(("API Error: Unexpected inputMediaAreaVenue from API."));
});
return result;
}
@@ -99,8 +102,32 @@ using UpdateFlag = StoryUpdate::Flag;
.flipped = data.is_flipped(),
.dark = data.is_dark(),
});
}, [&](const MTPDmediaAreaChannelPost &data) {
}, [&](const MTPDinputMediaAreaChannelPost &data) {
LOG(("API Error: Unexpected inputMediaAreaChannelPost from API."));
}, [&](const MTPDinputMediaAreaVenue &data) {
LOG(("API Error: Unexpected inputMediaAreaVenue in API data."));
LOG(("API Error: Unexpected inputMediaAreaVenue from API."));
});
return result;
}
[[nodiscard]] auto ParseChannelPost(const MTPMediaArea &area)
-> std::optional<ChannelPost> {
auto result = std::optional<ChannelPost>();
area.match([&](const MTPDmediaAreaVenue &data) {
}, [&](const MTPDmediaAreaGeoPoint &data) {
}, [&](const MTPDmediaAreaSuggestedReaction &data) {
}, [&](const MTPDmediaAreaChannelPost &data) {
result.emplace(ChannelPost{
.area = ParseArea(data.vcoordinates()),
.itemId = FullMsgId(
peerFromChannel(data.vchannel_id()),
data.vmsg_id().v),
});
}, [&](const MTPDinputMediaAreaChannelPost &data) {
LOG(("API Error: Unexpected inputMediaAreaChannelPost from API."));
}, [&](const MTPDinputMediaAreaVenue &data) {
LOG(("API Error: Unexpected inputMediaAreaVenue from API."));
});
return result;
}

View File

@@ -109,6 +109,15 @@ struct SuggestedReaction {
const SuggestedReaction &) = default;
};
struct ChannelPost {
StoryArea area;
FullMsgId itemId;
friend inline bool operator==(
const ChannelPost &,
const ChannelPost &) = default;
};
class Story final {
public:
Story(