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

Poll data and updates handling added.

This commit is contained in:
John Preston
2018-12-18 09:43:11 +04:00
parent 099440d008
commit 47bdeeef9a
13 changed files with 393 additions and 20 deletions

View File

@@ -246,6 +246,7 @@ public:
not_null<const DocumentData*> document);
void requestDocumentViewRepaint(not_null<const DocumentData*> document);
void markMediaRead(not_null<const DocumentData*> document);
void requestPollViewRepaint(not_null<const PollData*> poll);
not_null<PhotoData*> photo(PhotoId id);
not_null<PhotoData*> photo(const MTPPhoto &data);
@@ -330,6 +331,11 @@ public:
not_null<GameData*> original,
const MTPGame &data);
not_null<PollData*> poll(PollId id);
not_null<PollData*> poll(const MTPPoll &data);
not_null<PollData*> poll(const MTPDmessageMediaPoll &data);
void applyPollUpdate(const MTPDupdateMessagePoll &update);
not_null<LocationData*> location(const LocationCoords &coords);
void registerPhotoItem(
@@ -362,6 +368,12 @@ public:
void unregisterGameView(
not_null<const GameData*> game,
not_null<ViewElement*> view);
void registerPollView(
not_null<const PollData*> poll,
not_null<ViewElement*> view);
void unregisterPollView(
not_null<const PollData*> poll,
not_null<ViewElement*> view);
void registerContactView(
UserId contactId,
not_null<ViewElement*> view);
@@ -386,7 +398,9 @@ public:
void notifyWebPageUpdateDelayed(not_null<WebPageData*> page);
void notifyGameUpdateDelayed(not_null<GameData*> game);
void sendWebPageGameNotifications();
void notifyPollUpdateDelayed(not_null<PollData*> poll);
bool hasPendingWebPageGamePollNotification() const;
void sendWebPageGamePollNotifications();
void stopAutoplayAnimations();
@@ -604,21 +618,27 @@ private:
std::unordered_map<
WebPageId,
std::unique_ptr<WebPageData>> _webpages;
std::unordered_map<
LocationCoords,
std::unique_ptr<LocationData>> _locations;
std::map<
not_null<const WebPageData*>,
base::flat_set<not_null<HistoryItem*>>> _webpageItems;
std::map<
not_null<const WebPageData*>,
base::flat_set<not_null<ViewElement*>>> _webpageViews;
std::unordered_map<
LocationCoords,
std::unique_ptr<LocationData>> _locations;
std::unordered_map<
PollId,
std::unique_ptr<PollData>> _polls;
std::unordered_map<
GameId,
std::unique_ptr<GameData>> _games;
std::map<
not_null<const GameData*>,
base::flat_set<not_null<ViewElement*>>> _gameViews;
std::map<
not_null<const PollData*>,
base::flat_set<not_null<ViewElement*>>> _pollViews;
std::map<
UserId,
base::flat_set<not_null<HistoryItem*>>> _contactItems;
@@ -631,6 +651,7 @@ private:
base::flat_set<not_null<WebPageData*>> _webpagesUpdated;
base::flat_set<not_null<GameData*>> _gamesUpdated;
base::flat_set<not_null<PollData*>> _pollsUpdated;
std::deque<Dialogs::Key> _pinnedDialogs;
base::flat_map<FeedId, std::unique_ptr<Feed>> _feeds;