2017-09-25 09:02:55 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 10:23:14 +00:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2017-09-25 09:02:55 +00:00
|
|
|
|
2018-01-03 10:23:14 +00:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2017-09-25 09:02:55 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <rpl/producer.h>
|
|
|
|
#include <rpl/map.h>
|
|
|
|
|
2019-06-21 12:27:46 +00:00
|
|
|
struct ChannelLocation;
|
|
|
|
|
2021-12-13 11:26:19 +00:00
|
|
|
namespace Main {
|
|
|
|
class Session;
|
|
|
|
} // namespace Main
|
|
|
|
|
2017-09-25 09:02:55 +00:00
|
|
|
namespace Ui {
|
|
|
|
class RpWidget;
|
|
|
|
template <typename Widget>
|
|
|
|
class SlideWrap;
|
|
|
|
} // namespace Ui
|
|
|
|
|
2018-01-11 19:33:26 +00:00
|
|
|
namespace Storage {
|
2018-03-09 20:48:47 +00:00
|
|
|
enum class SharedMediaType : signed char;
|
2018-01-11 19:33:26 +00:00
|
|
|
} // namespace Storage
|
|
|
|
|
2017-09-25 09:02:55 +00:00
|
|
|
namespace Info {
|
|
|
|
namespace Profile {
|
|
|
|
|
2017-11-07 07:21:48 +00:00
|
|
|
inline auto ToSingleLine() {
|
|
|
|
return rpl::map([](const QString &text) {
|
|
|
|
return TextUtilities::SingleLine(text);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2019-07-16 12:54:38 +00:00
|
|
|
rpl::producer<not_null<PeerData*>> MigratedOrMeValue(
|
|
|
|
not_null<PeerData*> peer);
|
|
|
|
|
2022-03-15 11:12:49 +00:00
|
|
|
[[nodiscard]] rpl::producer<TextWithEntities> NameValue(
|
|
|
|
not_null<PeerData*> peer);
|
|
|
|
[[nodiscard]] rpl::producer<TextWithEntities> PhoneValue(
|
|
|
|
not_null<UserData*> user);
|
|
|
|
[[nodiscard]] rpl::producer<TextWithEntities> PhoneOrHiddenValue(
|
|
|
|
not_null<UserData*> user);
|
|
|
|
[[nodiscard]] rpl::producer<TextWithEntities> UsernameValue(
|
|
|
|
not_null<UserData*> user);
|
2021-10-18 13:21:49 +00:00
|
|
|
[[nodiscard]] TextWithEntities AboutWithEntities(
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
const QString &value);
|
2022-03-15 11:12:49 +00:00
|
|
|
[[nodiscard]] rpl::producer<TextWithEntities> AboutValue(
|
|
|
|
not_null<PeerData*> peer);
|
|
|
|
[[nodiscard]] rpl::producer<QString> LinkValue(not_null<PeerData*> peer);
|
|
|
|
[[nodiscard]] rpl::producer<const ChannelLocation*> LocationValue(
|
|
|
|
not_null<ChannelData*> channel);
|
|
|
|
[[nodiscard]] rpl::producer<bool> NotificationsEnabledValue(
|
|
|
|
not_null<PeerData*> peer);
|
|
|
|
[[nodiscard]] rpl::producer<bool> IsContactValue(not_null<UserData*> user);
|
|
|
|
[[nodiscard]] rpl::producer<bool> CanInviteBotToGroupValue(
|
|
|
|
not_null<UserData*> user);
|
|
|
|
[[nodiscard]] rpl::producer<bool> CanShareContactValue(
|
|
|
|
not_null<UserData*> user);
|
|
|
|
[[nodiscard]] rpl::producer<bool> CanAddContactValue(
|
|
|
|
not_null<UserData*> user);
|
|
|
|
[[nodiscard]] rpl::producer<bool> AmInChannelValue(
|
|
|
|
not_null<ChannelData*> channel);
|
|
|
|
[[nodiscard]] rpl::producer<int> MembersCountValue(not_null<PeerData*> peer);
|
|
|
|
[[nodiscard]] rpl::producer<int> PendingRequestsCountValue(
|
|
|
|
not_null<PeerData*> peer);
|
|
|
|
[[nodiscard]] rpl::producer<int> AdminsCountValue(not_null<PeerData*> peer);
|
|
|
|
[[nodiscard]] rpl::producer<int> RestrictionsCountValue(
|
|
|
|
not_null<PeerData*> peer);
|
|
|
|
[[nodiscard]] rpl::producer<int> RestrictedCountValue(
|
|
|
|
not_null<ChannelData*> channel);
|
|
|
|
[[nodiscard]] rpl::producer<int> KickedCountValue(
|
2019-06-21 12:27:46 +00:00
|
|
|
not_null<ChannelData*> channel);
|
2022-03-15 11:12:49 +00:00
|
|
|
[[nodiscard]] rpl::producer<int> SharedMediaCountValue(
|
2017-09-25 09:02:55 +00:00
|
|
|
not_null<PeerData*> peer,
|
2017-10-31 18:25:22 +00:00
|
|
|
PeerData *migrated,
|
2017-09-25 09:02:55 +00:00
|
|
|
Storage::SharedMediaType type);
|
2022-03-15 11:12:49 +00:00
|
|
|
[[nodiscard]] rpl::producer<int> CommonGroupsCountValue(
|
|
|
|
not_null<UserData*> user);
|
|
|
|
[[nodiscard]] rpl::producer<bool> CanAddMemberValue(
|
|
|
|
not_null<PeerData*> peer);
|
|
|
|
[[nodiscard]] rpl::producer<int> FullReactionsCountValue(
|
|
|
|
not_null<Main::Session*> peer);
|
|
|
|
[[nodiscard]] rpl::producer<int> AllowedReactionsCountValue(
|
|
|
|
not_null<PeerData*> peer);
|
2021-01-21 12:39:40 +00:00
|
|
|
|
|
|
|
enum class Badge {
|
|
|
|
None,
|
|
|
|
Verified,
|
|
|
|
Scam,
|
|
|
|
Fake,
|
|
|
|
};
|
2022-03-15 11:12:49 +00:00
|
|
|
[[nodiscard]] rpl::producer<Badge> BadgeValue(not_null<PeerData*> peer);
|
2017-09-25 09:02:55 +00:00
|
|
|
|
|
|
|
} // namespace Profile
|
|
|
|
} // namespace Info
|