2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Simplify GNotification actions

This commit is contained in:
Ilya Fedin
2025-02-18 13:24:35 +00:00
committed by John Preston
parent 2ab9587f5f
commit cf61dedc79
4 changed files with 80 additions and 119 deletions

View File

@@ -100,7 +100,6 @@ public:
void createManager();
void setManager(Fn<std::unique_ptr<Manager>()> create);
[[nodiscard]] Manager &manager() const;
void checkDelayed();
void schedule(Data::ItemNotification notification);
@@ -237,22 +236,6 @@ public:
friend inline auto operator<=>(
const ContextId&,
const ContextId&) = default;
[[nodiscard]] auto toAnyVector() const {
return std::vector<std::any>{
std::make_any<uint64>(sessionId),
std::make_any<uint64>(peerId.value),
std::make_any<int64>(topicRootId.bare),
};
}
[[nodiscard]] static auto FromAnyVector(const auto &vector) {
return ContextId{
std::any_cast<uint64>(vector[0]),
PeerIdHelper(std::any_cast<uint64>(vector[1])),
std::any_cast<int64>(vector[2]),
};
}
};
struct NotificationId {
ContextId contextId;
@@ -261,21 +244,6 @@ public:
friend inline auto operator<=>(
const NotificationId&,
const NotificationId&) = default;
[[nodiscard]] auto toAnyVector() const {
return std::vector<std::any>{
std::make_any<std::vector<std::any>>(contextId.toAnyVector()),
std::make_any<int64>(msgId.bare),
};
}
[[nodiscard]] static auto FromAnyVector(const auto &vector) {
return NotificationId{
ContextId::FromAnyVector(
std::any_cast<std::vector<std::any>>(vector[0])),
std::any_cast<int64>(vector[1]),
};
}
};
struct NotificationFields {
not_null<HistoryItem*> item;