mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Added usernames support to info profile.
This commit is contained in:
parent
ad7bc6326d
commit
79f592a84f
9 changed files with 155 additions and 43 deletions
|
@ -1144,6 +1144,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_info_mobile_label" = "Mobile";
|
"lng_info_mobile_label" = "Mobile";
|
||||||
"lng_info_mobile_hidden" = "Hidden";
|
"lng_info_mobile_hidden" = "Hidden";
|
||||||
"lng_info_username_label" = "Username";
|
"lng_info_username_label" = "Username";
|
||||||
|
"lng_info_usernames_label" = "also";
|
||||||
"lng_info_bio_label" = "Bio";
|
"lng_info_bio_label" = "Bio";
|
||||||
"lng_info_link_label" = "Link";
|
"lng_info_link_label" = "Link";
|
||||||
"lng_info_location_label" = "Location";
|
"lng_info_location_label" = "Location";
|
||||||
|
|
|
@ -67,6 +67,7 @@ struct PeerUpdate {
|
||||||
IsBlocked = (1ULL << 8),
|
IsBlocked = (1ULL << 8),
|
||||||
MessagesTTL = (1ULL << 9),
|
MessagesTTL = (1ULL << 9),
|
||||||
FullInfo = (1ULL << 10),
|
FullInfo = (1ULL << 10),
|
||||||
|
Usernames = (1ULL << 11),
|
||||||
|
|
||||||
// For users
|
// For users
|
||||||
CanShareContact = (1ULL << 11),
|
CanShareContact = (1ULL << 11),
|
||||||
|
|
|
@ -109,13 +109,18 @@ void ChannelData::setUsername(const QString &username) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChannelData::setUsernames(const Data::Usernames &usernames) {
|
void ChannelData::setUsernames(const Data::Usernames &usernames) {
|
||||||
_usernames = ranges::views::all(
|
auto newUsernames = ranges::views::all(
|
||||||
usernames
|
usernames
|
||||||
) | ranges::views::filter([&](const Data::Username &username) {
|
) | ranges::views::filter([&](const Data::Username &username) {
|
||||||
return username.active;
|
return username.active;
|
||||||
}) | ranges::views::transform([&](const Data::Username &username) {
|
}) | ranges::views::transform([&](const Data::Username &username) {
|
||||||
return username.username;
|
return username.username;
|
||||||
}) | ranges::to_vector;
|
}) | ranges::to_vector;
|
||||||
|
|
||||||
|
if (!ranges::equal(_usernames, newUsernames)) {
|
||||||
|
_usernames = std::move(newUsernames);
|
||||||
|
session().changes().peerUpdated(this, UpdateFlag::Usernames);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ChannelData::username() const {
|
QString ChannelData::username() const {
|
||||||
|
|
|
@ -121,13 +121,18 @@ void UserData::setName(const QString &newFirstName, const QString &newLastName,
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserData::setUsernames(const Data::Usernames &usernames) {
|
void UserData::setUsernames(const Data::Usernames &usernames) {
|
||||||
_usernames = ranges::views::all(
|
auto newUsernames = ranges::views::all(
|
||||||
usernames
|
usernames
|
||||||
) | ranges::views::filter([&](const Data::Username &username) {
|
) | ranges::views::filter([&](const Data::Username &username) {
|
||||||
return username.active;
|
return username.active;
|
||||||
}) | ranges::views::transform([&](const Data::Username &username) {
|
}) | ranges::views::transform([&](const Data::Username &username) {
|
||||||
return username.username;
|
return username.username;
|
||||||
}) | ranges::to_vector;
|
}) | ranges::to_vector;
|
||||||
|
|
||||||
|
if (!ranges::equal(_usernames, newUsernames)) {
|
||||||
|
_usernames = std::move(newUsernames);
|
||||||
|
session().changes().peerUpdated(this, UpdateFlag::Usernames);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserData::setUsername(const QString &username) {
|
void UserData::setUsername(const QString &username) {
|
||||||
|
|
|
@ -27,6 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/layers/generic_box.h"
|
#include "ui/layers/generic_box.h"
|
||||||
#include "ui/toast/toast.h"
|
#include "ui/toast/toast.h"
|
||||||
#include "ui/text/text_utilities.h" // Ui::Text::ToUpper
|
#include "ui/text/text_utilities.h" // Ui::Text::ToUpper
|
||||||
|
#include "ui/text/text_variant.h"
|
||||||
#include "history/history_location_manager.h" // LocationClickHandler.
|
#include "history/history_location_manager.h" // LocationClickHandler.
|
||||||
#include "history/view/history_view_context_menu.h" // HistoryView::ShowReportPeerBox
|
#include "history/view/history_view_context_menu.h" // HistoryView::ShowReportPeerBox
|
||||||
#include "boxes/abstract_box.h"
|
#include "boxes/abstract_box.h"
|
||||||
|
@ -67,12 +68,59 @@ namespace Info {
|
||||||
namespace Profile {
|
namespace Profile {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
object_ptr<Ui::RpWidget> CreateSkipWidget(
|
[[nodiscard]] rpl::producer<TextWithEntities> UsernamesSubtext(
|
||||||
|
not_null<PeerData*> peer,
|
||||||
|
rpl::producer<QString> fallback) {
|
||||||
|
return rpl::combine(
|
||||||
|
UsernamesValue(peer),
|
||||||
|
std::move(fallback)
|
||||||
|
) | rpl::map([](std::vector<TextWithEntities> usernames, QString text) {
|
||||||
|
if (usernames.size() < 2) {
|
||||||
|
return TextWithEntities{ .text = text };
|
||||||
|
} else {
|
||||||
|
auto result = TextWithEntities();
|
||||||
|
result.append(tr::lng_info_usernames_label(tr::now));
|
||||||
|
result.append(' ');
|
||||||
|
auto &&subrange = ranges::make_subrange(
|
||||||
|
begin(usernames) + 1,
|
||||||
|
end(usernames));
|
||||||
|
for (auto &username : std::move(subrange)) {
|
||||||
|
const auto isLast = (usernames.back() == username);
|
||||||
|
result.append(Ui::Text::Link(
|
||||||
|
'@' + base::take(username.text),
|
||||||
|
username.entities.front().data()));
|
||||||
|
if (!isLast) {
|
||||||
|
result.append(u", "_q);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] Fn<void(QString)> UsernamesLinkCallback(
|
||||||
|
not_null<PeerData*> peer,
|
||||||
|
Window::Show show,
|
||||||
|
const QString &addToLink) {
|
||||||
|
return [=](QString link) {
|
||||||
|
if (!link.startsWith(u"https://"_q)) {
|
||||||
|
link = peer->session().createInternalLinkFull(peer->userName());
|
||||||
|
}
|
||||||
|
if (!link.isEmpty()) {
|
||||||
|
QGuiApplication::clipboard()->setText(link + addToLink);
|
||||||
|
Ui::Toast::Show(
|
||||||
|
show.toastParent(),
|
||||||
|
tr::lng_username_copied(tr::now));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] object_ptr<Ui::RpWidget> CreateSkipWidget(
|
||||||
not_null<Ui::RpWidget*> parent) {
|
not_null<Ui::RpWidget*> parent) {
|
||||||
return Ui::CreateSkipWidget(parent, st::infoProfileSkip);
|
return Ui::CreateSkipWidget(parent, st::infoProfileSkip);
|
||||||
}
|
}
|
||||||
|
|
||||||
object_ptr<Ui::SlideWrap<>> CreateSlideSkipWidget(
|
[[nodiscard]] object_ptr<Ui::SlideWrap<>> CreateSlideSkipWidget(
|
||||||
not_null<Ui::RpWidget*> parent) {
|
not_null<Ui::RpWidget*> parent) {
|
||||||
auto result = Ui::CreateSlideSkipWidget(
|
auto result = Ui::CreateSlideSkipWidget(
|
||||||
parent,
|
parent,
|
||||||
|
@ -113,7 +161,7 @@ auto AddActionButton(
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Text, typename ToggleOn, typename Callback>
|
template <typename Text, typename ToggleOn, typename Callback>
|
||||||
auto AddMainButton(
|
[[nodiscard]] auto AddMainButton(
|
||||||
not_null<Ui::VerticalLayout*> parent,
|
not_null<Ui::VerticalLayout*> parent,
|
||||||
Text &&text,
|
Text &&text,
|
||||||
ToggleOn &&toggleOn,
|
ToggleOn &&toggleOn,
|
||||||
|
@ -263,23 +311,23 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto addInfoLineGeneric = [&](
|
const auto addInfoLineGeneric = [&](
|
||||||
rpl::producer<QString> &&label,
|
v::text::data &&label,
|
||||||
rpl::producer<TextWithEntities> &&text,
|
rpl::producer<TextWithEntities> &&text,
|
||||||
const style::FlatLabel &textSt = st::infoLabeled,
|
const style::FlatLabel &textSt = st::infoLabeled,
|
||||||
const style::margins &padding = st::infoProfileLabeledPadding) {
|
const style::margins &padding = st::infoProfileLabeledPadding) {
|
||||||
auto line = CreateTextWithLabel(
|
auto line = CreateTextWithLabel(
|
||||||
result,
|
result,
|
||||||
std::move(label) | Ui::Text::ToWithEntities(),
|
v::text::take_marked(std::move(label)),
|
||||||
std::move(text),
|
std::move(text),
|
||||||
textSt,
|
textSt,
|
||||||
padding);
|
padding);
|
||||||
tracker.track(result->add(std::move(line.wrap)));
|
tracker.track(result->add(std::move(line.wrap)));
|
||||||
|
|
||||||
line.text->setClickHandlerFilter(infoClickFilter);
|
line.text->setClickHandlerFilter(infoClickFilter);
|
||||||
return line.text;
|
return line;
|
||||||
};
|
};
|
||||||
const auto addInfoLine = [&](
|
const auto addInfoLine = [&](
|
||||||
rpl::producer<QString> &&label,
|
v::text::data &&label,
|
||||||
rpl::producer<TextWithEntities> &&text,
|
rpl::producer<TextWithEntities> &&text,
|
||||||
const style::FlatLabel &textSt = st::infoLabeled,
|
const style::FlatLabel &textSt = st::infoLabeled,
|
||||||
const style::margins &padding = st::infoProfileLabeledPadding) {
|
const style::margins &padding = st::infoProfileLabeledPadding) {
|
||||||
|
@ -290,17 +338,17 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
||||||
padding);
|
padding);
|
||||||
};
|
};
|
||||||
const auto addInfoOneLine = [&](
|
const auto addInfoOneLine = [&](
|
||||||
rpl::producer<QString> &&label,
|
v::text::data &&label,
|
||||||
rpl::producer<TextWithEntities> &&text,
|
rpl::producer<TextWithEntities> &&text,
|
||||||
const QString &contextCopyText,
|
const QString &contextCopyText,
|
||||||
const style::margins &padding = st::infoProfileLabeledPadding) {
|
const style::margins &padding = st::infoProfileLabeledPadding) {
|
||||||
const auto result = addInfoLine(
|
auto result = addInfoLine(
|
||||||
std::move(label),
|
std::move(label),
|
||||||
std::move(text),
|
std::move(text),
|
||||||
st::infoLabeledOneLine,
|
st::infoLabeledOneLine,
|
||||||
padding);
|
padding);
|
||||||
result->setDoubleClickSelectsParagraph(true);
|
result.text->setDoubleClickSelectsParagraph(true);
|
||||||
result->setContextCopyText(contextCopyText);
|
result.text->setContextCopyText(contextCopyText);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
if (const auto user = _peer->asUser()) {
|
if (const auto user = _peer->asUser()) {
|
||||||
|
@ -320,11 +368,16 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
||||||
: tr::lng_info_bio_label();
|
: tr::lng_info_bio_label();
|
||||||
addInfoLine(std::move(label), AboutValue(user));
|
addInfoLine(std::move(label), AboutValue(user));
|
||||||
|
|
||||||
const auto usernameLabel = addInfoOneLine(
|
const auto usernameLine = addInfoOneLine(
|
||||||
tr::lng_info_username_label(),
|
UsernamesSubtext(_peer, tr::lng_info_username_label()),
|
||||||
UsernameValue(user),
|
UsernameValue(user, true),
|
||||||
tr::lng_context_copy_mention(tr::now),
|
tr::lng_context_copy_mention(tr::now),
|
||||||
st::infoProfileLabeledUsernamePadding);
|
st::infoProfileLabeledUsernamePadding);
|
||||||
|
usernameLine.subtext->overrideLinkClickHandler(UsernamesLinkCallback(
|
||||||
|
_peer,
|
||||||
|
Window::Show(controller),
|
||||||
|
QString()));
|
||||||
|
const auto usernameLabel = usernameLine.text;
|
||||||
if (user->isBot()) {
|
if (user->isBot()) {
|
||||||
const auto copyUsername = Ui::CreateChild<Ui::IconButton>(
|
const auto copyUsername = Ui::CreateChild<Ui::IconButton>(
|
||||||
usernameLabel->parentWidget(),
|
usernameLabel->parentWidget(),
|
||||||
|
@ -361,7 +414,8 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
||||||
? "?topic=" + QString::number(topicRootId.bare)
|
? "?topic=" + QString::number(topicRootId.bare)
|
||||||
: QString();
|
: QString();
|
||||||
auto linkText = LinkValue(
|
auto linkText = LinkValue(
|
||||||
_peer
|
_peer,
|
||||||
|
true
|
||||||
) | rpl::map([=](const QString &link) {
|
) | rpl::map([=](const QString &link) {
|
||||||
return link.isEmpty()
|
return link.isEmpty()
|
||||||
? TextWithEntities()
|
? TextWithEntities()
|
||||||
|
@ -371,21 +425,17 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
||||||
: link) + addToLink,
|
: link) + addToLink,
|
||||||
link + addToLink);
|
link + addToLink);
|
||||||
});
|
});
|
||||||
auto link = addInfoOneLine(
|
auto linkLine = addInfoOneLine(
|
||||||
tr::lng_info_link_label(),
|
UsernamesSubtext(_peer, tr::lng_info_link_label()),
|
||||||
std::move(linkText),
|
std::move(linkText),
|
||||||
QString());
|
QString());
|
||||||
const auto controller = _controller->parentController();
|
const auto controller = _controller->parentController();
|
||||||
link->overrideLinkClickHandler([=, peer = _peer] {
|
const auto linkCallback = UsernamesLinkCallback(
|
||||||
const auto link = peer->session().createInternalLinkFull(
|
_peer,
|
||||||
peer->userName());
|
Window::Show(controller),
|
||||||
if (!link.isEmpty()) {
|
addToLink);
|
||||||
QGuiApplication::clipboard()->setText(link + addToLink);
|
linkLine.text->overrideLinkClickHandler(linkCallback);
|
||||||
Ui::Toast::Show(
|
linkLine.subtext->overrideLinkClickHandler(linkCallback);
|
||||||
Window::Show(controller).toastParent(),
|
|
||||||
tr::lng_username_copied(tr::now));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (const auto channel = _topic ? nullptr : _peer->asChannel()) {
|
if (const auto channel = _topic ? nullptr : _peer->asChannel()) {
|
||||||
auto locationText = LocationValue(
|
auto locationText = LocationValue(
|
||||||
|
@ -401,7 +451,7 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
||||||
tr::lng_info_location_label(),
|
tr::lng_info_location_label(),
|
||||||
std::move(locationText),
|
std::move(locationText),
|
||||||
QString()
|
QString()
|
||||||
)->setLinksTrusted();
|
).text->setLinksTrusted();
|
||||||
}
|
}
|
||||||
|
|
||||||
addInfoLine(
|
addInfoLine(
|
||||||
|
|
|
@ -51,7 +51,7 @@ TextWithLabel CreateTextWithLabel(
|
||||||
textSt));
|
textSt));
|
||||||
labeled->setSelectable(true);
|
labeled->setSelectable(true);
|
||||||
layout->add(Ui::CreateSkipWidget(layout, st::infoLabelSkip));
|
layout->add(Ui::CreateSkipWidget(layout, st::infoLabelSkip));
|
||||||
layout->add(object_ptr<Ui::FlatLabel>(
|
const auto subtext = layout->add(object_ptr<Ui::FlatLabel>(
|
||||||
layout,
|
layout,
|
||||||
std::move(
|
std::move(
|
||||||
label
|
label
|
||||||
|
@ -60,7 +60,7 @@ TextWithLabel CreateTextWithLabel(
|
||||||
}),
|
}),
|
||||||
st::infoLabel));
|
st::infoLabel));
|
||||||
result->finishAnimating();
|
result->finishAnimating();
|
||||||
return { std::move(result), labeled };
|
return { std::move(result), labeled, subtext };
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Profile
|
} // namespace Profile
|
||||||
|
|
|
@ -28,6 +28,7 @@ namespace Profile {
|
||||||
struct TextWithLabel {
|
struct TextWithLabel {
|
||||||
object_ptr<Ui::SlideWrap<Ui::VerticalLayout>> wrap;
|
object_ptr<Ui::SlideWrap<Ui::VerticalLayout>> wrap;
|
||||||
not_null<Ui::FlatLabel*> text;
|
not_null<Ui::FlatLabel*> text;
|
||||||
|
not_null<Ui::FlatLabel*> subtext;
|
||||||
};
|
};
|
||||||
|
|
||||||
TextWithLabel CreateTextWithLabel(
|
TextWithLabel CreateTextWithLabel(
|
||||||
|
|
|
@ -47,14 +47,26 @@ auto PlainAboutValue(not_null<PeerData*> peer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto PlainUsernameValue(not_null<PeerData*> peer) {
|
auto PlainUsernameValue(not_null<PeerData*> peer) {
|
||||||
return peer->session().changes().peerFlagsValue(
|
return rpl::merge(
|
||||||
peer,
|
peer->session().changes().peerFlagsValue(peer, UpdateFlag::Username),
|
||||||
UpdateFlag::Username
|
peer->session().changes().peerFlagsValue(peer, UpdateFlag::Usernames)
|
||||||
) | rpl::map([=] {
|
) | rpl::map([=] {
|
||||||
return peer->userName();
|
return peer->userName();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto PlainPrimaryUsernameValue(not_null<PeerData*> peer) {
|
||||||
|
return UsernamesValue(
|
||||||
|
peer
|
||||||
|
) | rpl::map([=](std::vector<TextWithEntities> usernames) {
|
||||||
|
if (!usernames.empty()) {
|
||||||
|
return rpl::single(usernames.front().text);
|
||||||
|
} else {
|
||||||
|
return PlainUsernameValue(peer);
|
||||||
|
}
|
||||||
|
}) | rpl::flatten_latest();
|
||||||
|
}
|
||||||
|
|
||||||
void StripExternalLinks(TextWithEntities &text) {
|
void StripExternalLinks(TextWithEntities &text) {
|
||||||
const auto local = [](const QString &url) {
|
const auto local = [](const QString &url) {
|
||||||
return !UrlRequiresConfirmation(QUrl::fromUserInput(url));
|
return !UrlRequiresConfirmation(QUrl::fromUserInput(url));
|
||||||
|
@ -124,9 +136,12 @@ rpl::producer<TextWithEntities> PhoneOrHiddenValue(not_null<UserData*> user) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<TextWithEntities> UsernameValue(not_null<UserData*> user) {
|
rpl::producer<TextWithEntities> UsernameValue(
|
||||||
return PlainUsernameValue(
|
not_null<UserData*> user,
|
||||||
user
|
bool primary) {
|
||||||
|
return (primary
|
||||||
|
? PlainPrimaryUsernameValue(user)
|
||||||
|
: PlainUsernameValue(user)
|
||||||
) | rpl::map([](QString &&username) {
|
) | rpl::map([](QString &&username) {
|
||||||
return username.isEmpty()
|
return username.isEmpty()
|
||||||
? QString()
|
? QString()
|
||||||
|
@ -134,6 +149,34 @@ rpl::producer<TextWithEntities> UsernameValue(not_null<UserData*> user) {
|
||||||
}) | Ui::Text::ToWithEntities();
|
}) | Ui::Text::ToWithEntities();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rpl::producer<std::vector<TextWithEntities>> UsernamesValue(
|
||||||
|
not_null<PeerData*> peer) {
|
||||||
|
const auto map = [=](const std::vector<QString> &usernames) {
|
||||||
|
return ranges::views::all(
|
||||||
|
usernames
|
||||||
|
) | ranges::views::transform([&](const QString &u) {
|
||||||
|
return Ui::Text::Link(
|
||||||
|
u,
|
||||||
|
peer->session().createInternalLinkFull(u));
|
||||||
|
}) | ranges::to_vector;
|
||||||
|
};
|
||||||
|
auto value = rpl::merge(
|
||||||
|
peer->session().changes().peerFlagsValue(peer, UpdateFlag::Username),
|
||||||
|
peer->session().changes().peerFlagsValue(peer, UpdateFlag::Usernames)
|
||||||
|
);
|
||||||
|
if (const auto user = peer->asUser()) {
|
||||||
|
return std::move(value) | rpl::map([=] {
|
||||||
|
return map(user->usernames());
|
||||||
|
});
|
||||||
|
} else if (const auto channel = peer->asChannel()) {
|
||||||
|
return std::move(value) | rpl::map([=] {
|
||||||
|
return map(channel->usernames());
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
return rpl::never<std::vector<TextWithEntities>>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TextWithEntities AboutWithEntities(
|
TextWithEntities AboutWithEntities(
|
||||||
not_null<PeerData*> peer,
|
not_null<PeerData*> peer,
|
||||||
const QString &value) {
|
const QString &value) {
|
||||||
|
@ -170,9 +213,10 @@ rpl::producer<TextWithEntities> AboutValue(not_null<PeerData*> peer) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<QString> LinkValue(not_null<PeerData*> peer) {
|
rpl::producer<QString> LinkValue(not_null<PeerData*> peer, bool primary) {
|
||||||
return PlainUsernameValue(
|
return (primary
|
||||||
peer
|
? PlainPrimaryUsernameValue(peer)
|
||||||
|
: PlainUsernameValue(peer)
|
||||||
) | rpl::map([=](QString &&username) {
|
) | rpl::map([=](QString &&username) {
|
||||||
return username.isEmpty()
|
return username.isEmpty()
|
||||||
? QString()
|
? QString()
|
||||||
|
|
|
@ -54,13 +54,18 @@ rpl::producer<not_null<PeerData*>> MigratedOrMeValue(
|
||||||
[[nodiscard]] rpl::producer<TextWithEntities> PhoneOrHiddenValue(
|
[[nodiscard]] rpl::producer<TextWithEntities> PhoneOrHiddenValue(
|
||||||
not_null<UserData*> user);
|
not_null<UserData*> user);
|
||||||
[[nodiscard]] rpl::producer<TextWithEntities> UsernameValue(
|
[[nodiscard]] rpl::producer<TextWithEntities> UsernameValue(
|
||||||
not_null<UserData*> user);
|
not_null<UserData*> user,
|
||||||
|
bool primary = false);
|
||||||
|
[[nodiscard]] rpl::producer<std::vector<TextWithEntities>> UsernamesValue(
|
||||||
|
not_null<PeerData*> peer);
|
||||||
[[nodiscard]] TextWithEntities AboutWithEntities(
|
[[nodiscard]] TextWithEntities AboutWithEntities(
|
||||||
not_null<PeerData*> peer,
|
not_null<PeerData*> peer,
|
||||||
const QString &value);
|
const QString &value);
|
||||||
[[nodiscard]] rpl::producer<TextWithEntities> AboutValue(
|
[[nodiscard]] rpl::producer<TextWithEntities> AboutValue(
|
||||||
not_null<PeerData*> peer);
|
not_null<PeerData*> peer);
|
||||||
[[nodiscard]] rpl::producer<QString> LinkValue(not_null<PeerData*> peer);
|
[[nodiscard]] rpl::producer<QString> LinkValue(
|
||||||
|
not_null<PeerData*> peer,
|
||||||
|
bool primary = false);
|
||||||
[[nodiscard]] rpl::producer<const ChannelLocation*> LocationValue(
|
[[nodiscard]] rpl::producer<const ChannelLocation*> LocationValue(
|
||||||
not_null<ChannelData*> channel);
|
not_null<ChannelData*> channel);
|
||||||
[[nodiscard]] rpl::producer<bool> NotificationsEnabledValue(
|
[[nodiscard]] rpl::producer<bool> NotificationsEnabledValue(
|
||||||
|
|
Loading…
Add table
Reference in a new issue