Improve support accounts presentation.

- Change "Bot Info" to "User Info".
- Remove "Block user" and "Add to Group" buttons from profile page.
- Allow revoking messages from support chats.
This commit is contained in:
John Preston 2019-04-03 16:14:05 +04:00
parent 3e374eda51
commit b364cbbd69
4 changed files with 8 additions and 8 deletions

View File

@ -493,7 +493,7 @@ bool HistoryItem::canDeleteForEveryone(TimeId now) const {
} else if (const auto user = peer->asUser()) {
// Bots receive all messages and there is no sense in revoking them.
// See https://github.com/telegramdesktop/tdesktop/issues/3818
if (user->botInfo) {
if (user->isBot() && !user->isSupport()) {
return false;
}
}

View File

@ -556,11 +556,11 @@ rpl::producer<QString> TitleValue(
case Section::Type::Profile:
if (const auto feed = key.feed()) {
return lng_info_feed_title;
} else if (auto user = peer->asUser()) {
return user->botInfo
} else if (const auto user = peer->asUser()) {
return (user->isBot() && !user->isSupport())
? lng_info_bot_title
: lng_info_user_title;
} else if (auto channel = peer->asChannel()) {
} else if (const auto channel = peer->asChannel()) {
return channel->isMegagroup()
? lng_info_group_title
: lng_info_channel_title;

View File

@ -652,14 +652,14 @@ void ActionsFiller::fillUserActions(not_null<UserData*> user) {
}
addClearHistoryAction(user);
addDeleteConversationAction(user);
if (!user->isSelf()) {
if (user->botInfo) {
if (!user->isSelf() && !user->isSupport()) {
if (user->isBot()) {
addBotCommandActions(user);
}
_wrap->add(CreateSkipWidget(
_wrap,
st::infoBlockButtonSkip));
if (user->isBot() && !user->isSupport()) {
if (user->isBot()) {
addReportAction();
}
addBlockAction(user);

View File

@ -136,7 +136,7 @@ rpl::producer<bool> IsContactValue(not_null<UserData*> user) {
}
rpl::producer<bool> CanInviteBotToGroupValue(not_null<UserData*> user) {
if (!user->botInfo) {
if (!user->isBot() || user->isSupport()) {
return rpl::single(false);
}
return Notify::PeerUpdateValue(