Added tooltip to original link too.

This commit is contained in:
23rd 2018-08-25 21:47:25 +03:00
parent f4828b7d09
commit c7e2188582

View file

@ -269,17 +269,18 @@ void TwitchMessageBuilder::addTextOrEmoji(const QString &string_)
link = Link(Link::Url, linkString);
textColor = MessageColor(MessageColor::Link);
auto linkMessageElement = this->emplace<TextElement>(lowercaseLinkString,
auto linkMELowercase = this->emplace<TextElement>(lowercaseLinkString,
MessageElementFlag::LowercaseLink, textColor)
->setLink(link);
this->emplace<TextElement>(string, MessageElementFlag::OriginalLink,
textColor)
auto linkMEOriginal = this->emplace<TextElement>(string,
MessageElementFlag::OriginalLink, textColor)
->setLink(link);
LinkResolver::getLinkInfo(
linkString, [linkMessageElement](QString tooltipText) {
linkString, [linkMELowercase, linkMEOriginal](QString tooltipText) {
if (!tooltipText.isEmpty()) {
linkMessageElement->setTooltip(tooltipText);
linkMELowercase->setTooltip(tooltipText);
linkMEOriginal->setTooltip(tooltipText);
}
});
}