[Improvement] Do not strip links in bio
This commit is contained in:
		
							parent
							
								
									a14c633385
								
							
						
					
					
						commit
						be291a81fe
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		| 
						 | 
					@ -52,6 +52,7 @@ auto PlainUsernameValue(not_null<PeerData*> peer) {
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/*
 | 
				
			||||||
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));
 | 
				
			||||||
| 
						 | 
					@ -69,6 +70,7 @@ void StripExternalLinks(TextWithEntities &text) {
 | 
				
			||||||
		ranges::remove_if(text.entities, notLocal),
 | 
							ranges::remove_if(text.entities, notLocal),
 | 
				
			||||||
		text.entities.end());
 | 
							text.entities.end());
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
} // namespace
 | 
					} // namespace
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -152,14 +154,18 @@ TextWithEntities AboutWithEntities(
 | 
				
			||||||
	} else if (isBot) {
 | 
						} else if (isBot) {
 | 
				
			||||||
		flags |= TextParseHashtags | TextParseBotCommands;
 | 
							flags |= TextParseHashtags | TextParseBotCommands;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
	const auto stripExternal = peer->isChat()
 | 
						const auto stripExternal = peer->isChat()
 | 
				
			||||||
		|| peer->isMegagroup()
 | 
							|| peer->isMegagroup()
 | 
				
			||||||
		|| (user && !isBot);
 | 
							|| (user && !isBot);
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
	auto result = TextWithEntities{ value };
 | 
						auto result = TextWithEntities{ value };
 | 
				
			||||||
	TextUtilities::ParseEntities(result, flags);
 | 
						TextUtilities::ParseEntities(result, flags);
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
	if (stripExternal) {
 | 
						if (stripExternal) {
 | 
				
			||||||
		StripExternalLinks(result);
 | 
							StripExternalLinks(result);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
	return result;
 | 
						return result;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue