mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Show invite links list with context menu.
This commit is contained in:
@@ -218,6 +218,12 @@ void InviteLinks::revoke(
|
||||
performEdit(peer, link, std::move(done), true);
|
||||
}
|
||||
|
||||
void InviteLinks::revokePermanent(
|
||||
not_null<PeerData*> peer,
|
||||
Fn<void(Link)> done) {
|
||||
performCreate(peer, std::move(done), true);
|
||||
}
|
||||
|
||||
void InviteLinks::requestLinks(not_null<PeerData*> peer) {
|
||||
if (_firstSliceRequests.contains(peer)) {
|
||||
return;
|
||||
@@ -411,6 +417,7 @@ auto InviteLinks::parse(
|
||||
.link = qs(data.vlink()),
|
||||
.admin = peer->session().data().user(data.vadmin_id().v),
|
||||
.date = data.vdate().v,
|
||||
.startDate = data.vstart_date().value_or_empty(),
|
||||
.expireDate = data.vexpire_date().value_or_empty(),
|
||||
.usageLimit = data.vusage_limit().value_or_empty(),
|
||||
.usage = data.vusage().value_or_empty(),
|
||||
|
@@ -14,7 +14,8 @@ namespace Api {
|
||||
struct InviteLink {
|
||||
QString link;
|
||||
not_null<UserData*> admin;
|
||||
TimeId date;
|
||||
TimeId date = 0;
|
||||
TimeId startDate = 0;
|
||||
TimeId expireDate = 0;
|
||||
int usageLimit = 0;
|
||||
int usage = 0;
|
||||
@@ -60,6 +61,9 @@ public:
|
||||
not_null<PeerData*> peer,
|
||||
const QString &link,
|
||||
Fn<void(Link)> done = nullptr);
|
||||
void revokePermanent(
|
||||
not_null<PeerData*> peer,
|
||||
Fn<void(Link)> done = nullptr);
|
||||
|
||||
void setPermanent(
|
||||
not_null<PeerData*> peer,
|
||||
|
Reference in New Issue
Block a user