/* 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/box_content.h" class UserData; class ChannelData; namespace Main { class Session; } // namespace Main namespace Window { class SessionController; } // namespace Window namespace Data { class CloudImageView; class PhotoMedia; } // namespace Data namespace Ui { class EmptyUserpic; } // namespace Ui namespace Api { void CheckChatInvite( not_null controller, const QString &hash, ChannelData *invitePeekChannel = nullptr); } // namespace Api class ConfirmInviteBox final : public Ui::BoxContent { public: ConfirmInviteBox( QWidget*, not_null session, const MTPDchatInvite &data, ChannelData *invitePeekChannel, Fn submit); ~ConfirmInviteBox(); protected: void prepare() override; void resizeEvent(QResizeEvent *e) override; void paintEvent(QPaintEvent *e) override; private: struct Participant { not_null user; std::shared_ptr userpic; }; struct ChatInvite { QString title; QString about; PhotoData *photo = nullptr; int participantsCount = 0; std::vector participants; bool isPublic = false; bool isChannel = false; bool isMegagroup = false; bool isBroadcast = false; bool isRequestNeeded = false; }; [[nodiscard]] static ChatInvite Parse( not_null session, const MTPDchatInvite &data); ConfirmInviteBox( not_null session, ChatInvite &&invite, ChannelData *invitePeekChannel, Fn submit); const not_null _session; Fn _submit; object_ptr _title; object_ptr _status; object_ptr _about; object_ptr _aboutRequests; std::shared_ptr _photo; std::unique_ptr _photoEmpty; std::vector _participants; bool _isChannel = false; bool _requestApprove = false; int _userWidth = 0; };