From 747ebd2136d410e093184d4eb7ca1b8d3411cb84 Mon Sep 17 00:00:00 2001
From: John Preston <johnprestonmail@gmail.com>
Date: Fri, 17 Nov 2017 11:42:53 +0400
Subject: [PATCH] Make links clickable in channel descriptions.

---
 .../info/profile/info_profile_values.cpp      | 35 +++++++++++--------
 1 file changed, 21 insertions(+), 14 deletions(-)

diff --git a/Telegram/SourceFiles/info/profile/info_profile_values.cpp b/Telegram/SourceFiles/info/profile/info_profile_values.cpp
index 31423357f..423eb09a0 100644
--- a/Telegram/SourceFiles/info/profile/info_profile_values.cpp
+++ b/Telegram/SourceFiles/info/profile/info_profile_values.cpp
@@ -80,29 +80,36 @@ rpl::producer<TextWithEntities> UsernameValue(
 		| WithEmptyEntities();
 }
 
-rpl::producer<TextWithEntities> AboutValue(
+rpl::producer<QString> PlainAboutValue(
 		not_null<PeerData*> peer) {
 	if (auto channel = peer->asChannel()) {
 		return Notify::PeerUpdateValue(
 				channel,
 				Notify::PeerUpdate::Flag::AboutChanged)
-			| rpl::map([channel] { return channel->about(); })
-			| WithEmptyEntities();
+			| rpl::map([channel] { return channel->about(); });
 	} else if (auto user = peer->asUser()) {
 		if (user->botInfo) {
-			return PlainBioValue(user)
-				| WithEmptyEntities()
-				| rpl::map([](TextWithEntities &&text) {
-					auto flags = TextParseLinks
-						| TextParseMentions
-						| TextParseHashtags
-						| TextParseBotCommands;
-					TextUtilities::ParseEntities(text, flags);
-					return std::move(text);
-				});
+			return PlainBioValue(user);
 		}
 	}
-	return rpl::single(TextWithEntities{});
+	return rpl::single(QString());
+}
+
+
+rpl::producer<TextWithEntities> AboutValue(
+		not_null<PeerData*> peer) {
+	auto flags = TextParseLinks
+		| TextParseMentions
+		| TextParseHashtags;
+	if (peer->isUser()) {
+		flags |= TextParseBotCommands;
+	}
+	return PlainAboutValue(peer)
+		| WithEmptyEntities()
+		| rpl::map([=](TextWithEntities &&text) {
+			TextUtilities::ParseEntities(text, flags);
+			return std::move(text);
+		});
 }
 
 rpl::producer<QString> LinkValue(