2021-01-19 10:56:01 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
|
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "ui/layers/generic_box.h"
|
|
|
|
|
|
|
|
class PeerData;
|
|
|
|
|
|
|
|
namespace Api {
|
|
|
|
struct InviteLink;
|
|
|
|
} // namespace Api
|
|
|
|
|
2023-03-21 16:27:16 +00:00
|
|
|
namespace Main {
|
|
|
|
class Session;
|
|
|
|
} // namespace Main
|
|
|
|
|
2021-01-19 10:56:01 +00:00
|
|
|
namespace Ui {
|
|
|
|
class VerticalLayout;
|
2022-03-06 05:14:34 +00:00
|
|
|
class Show;
|
2021-01-19 10:56:01 +00:00
|
|
|
} // namespace Ui
|
|
|
|
|
2021-02-08 15:04:21 +00:00
|
|
|
[[nodiscard]] bool IsExpiredLink(const Api::InviteLink &data, TimeId now);
|
|
|
|
|
2021-02-05 17:35:29 +00:00
|
|
|
void AddSinglePeerRow(
|
|
|
|
not_null<Ui::VerticalLayout*> container,
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
rpl::producer<QString> status);
|
|
|
|
|
2021-01-19 10:56:01 +00:00
|
|
|
void AddPermanentLinkBlock(
|
2022-03-06 05:14:34 +00:00
|
|
|
std::shared_ptr<Ui::Show> show,
|
2021-01-19 10:56:01 +00:00
|
|
|
not_null<Ui::VerticalLayout*> container,
|
2021-02-05 13:22:02 +00:00
|
|
|
not_null<PeerData*> peer,
|
|
|
|
not_null<UserData*> admin,
|
|
|
|
rpl::producer<Api::InviteLink> fromList);
|
2021-01-19 10:56:01 +00:00
|
|
|
|
2023-05-02 09:33:19 +00:00
|
|
|
void CopyInviteLink(std::shared_ptr<Ui::Show> show, const QString &link);
|
2022-03-06 06:04:04 +00:00
|
|
|
[[nodiscard]] object_ptr<Ui::BoxContent> ShareInviteLinkBox(
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
const QString &link);
|
2023-03-21 16:27:16 +00:00
|
|
|
[[nodiscard]] object_ptr<Ui::BoxContent> ShareInviteLinkBox(
|
|
|
|
not_null<Main::Session*> session,
|
|
|
|
const QString &link);
|
2023-04-03 07:58:30 +00:00
|
|
|
[[nodiscard]] object_ptr<Ui::BoxContent> InviteLinkQrBox(
|
|
|
|
const QString &link,
|
|
|
|
rpl::producer<QString> about);
|
2022-03-06 05:43:04 +00:00
|
|
|
[[nodiscard]] object_ptr<Ui::BoxContent> RevokeLinkBox(
|
2021-02-05 13:22:02 +00:00
|
|
|
not_null<PeerData*> peer,
|
|
|
|
not_null<UserData*> admin,
|
2022-03-06 05:43:04 +00:00
|
|
|
const QString &link,
|
|
|
|
bool permanent = false);
|
2022-03-06 05:34:07 +00:00
|
|
|
[[nodiscard]] object_ptr<Ui::BoxContent> EditLinkBox(
|
2021-02-08 15:04:21 +00:00
|
|
|
not_null<PeerData*> peer,
|
|
|
|
const Api::InviteLink &data);
|
2022-03-06 05:28:21 +00:00
|
|
|
[[nodiscard]] object_ptr<Ui::BoxContent> DeleteLinkBox(
|
2021-02-10 12:14:53 +00:00
|
|
|
not_null<PeerData*> peer,
|
|
|
|
not_null<UserData*> admin,
|
|
|
|
const QString &link);
|
2021-01-19 10:56:01 +00:00
|
|
|
|
2022-03-06 05:25:12 +00:00
|
|
|
[[nodiscard]] object_ptr<Ui::BoxContent> ShowInviteLinkBox(
|
2021-01-19 10:56:01 +00:00
|
|
|
not_null<PeerData*> peer,
|
|
|
|
const Api::InviteLink &link);
|
2021-10-13 20:08:13 +00:00
|
|
|
|
|
|
|
[[nodiscard]] QString PrepareRequestedRowStatus(TimeId date);
|