2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Process gift updates in list.

This commit is contained in:
John Preston
2024-09-24 23:00:22 +04:00
parent 779e9b658b
commit 962d4d29ee
12 changed files with 177 additions and 34 deletions

View File

@@ -77,6 +77,18 @@ struct RepliesReadTillUpdate {
bool out = false;
};
struct GiftUpdate {
enum class Action : uchar {
Save,
Unsave,
Convert,
Delete,
};
FullMsgId itemId;
Action action = {};
};
class Session final {
public:
using ViewElement = HistoryView::Element;
@@ -281,6 +293,8 @@ public:
[[nodiscard]] rpl::producer<not_null<const ViewElement*>> viewLayoutChanged() const;
void notifyNewItemAdded(not_null<HistoryItem*> item);
[[nodiscard]] rpl::producer<not_null<HistoryItem*>> newItemAdded() const;
void notifyGiftUpdate(GiftUpdate &&update);
[[nodiscard]] rpl::producer<GiftUpdate> giftUpdates() const;
void requestItemRepaint(not_null<const HistoryItem*> item);
[[nodiscard]] rpl::producer<not_null<const HistoryItem*>> itemRepaintRequest() const;
void requestViewRepaint(not_null<const ViewElement*> view);
@@ -924,6 +938,7 @@ private:
rpl::event_stream<not_null<const HistoryItem*>> _itemLayoutChanges;
rpl::event_stream<not_null<const ViewElement*>> _viewLayoutChanges;
rpl::event_stream<not_null<HistoryItem*>> _newItemAdded;
rpl::event_stream<GiftUpdate> _giftUpdates;
rpl::event_stream<not_null<const HistoryItem*>> _itemRepaintRequest;
rpl::event_stream<not_null<const ViewElement*>> _viewRepaintRequest;
rpl::event_stream<not_null<const HistoryItem*>> _itemResizeRequest;