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

Push recent requests from requests box to the bar.

This commit is contained in:
John Preston
2021-10-14 14:47:23 +04:00
parent 7543351bc9
commit 8618f6d7eb
6 changed files with 118 additions and 57 deletions

View File

@@ -759,6 +759,15 @@ void InviteLinks::requestMoreLinks(
}).send();
}
void InviteLinks::pushRecentRequests(RecentRequests &&requests) {
_recentRequestsLocal.fire(std::move(requests));
}
auto InviteLinks::recentRequestsLocal() const
-> rpl::producer<RecentRequests> {
return _recentRequestsLocal.events();
}
void InviteLinks::editPermanentLink(
not_null<PeerData*> peer,
const QString &link) {

View File

@@ -132,6 +132,13 @@ public:
bool revoked,
Fn<void(Links)> done);
struct RecentRequests {
not_null<PeerData*> peer;
std::vector<not_null<UserData*>> users;
};
void pushRecentRequests(RecentRequests &&requests);
[[nodiscard]] rpl::producer<RecentRequests> recentRequestsLocal() const;
private:
struct LinkKey {
not_null<PeerData*> peer;
@@ -216,6 +223,7 @@ private:
base::flat_map<
std::pair<not_null<PeerData*>, not_null<UserData*>>,
ProcessRequest> _processRequests;
rpl::event_stream<RecentRequests> _recentRequestsLocal;
rpl::event_stream<Update> _updates;