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); link = Link(Link::Url, linkString);
textColor = MessageColor(MessageColor::Link); textColor = MessageColor(MessageColor::Link);
auto linkMessageElement = this->emplace<TextElement>(lowercaseLinkString, auto linkMELowercase = this->emplace<TextElement>(lowercaseLinkString,
MessageElementFlag::LowercaseLink, textColor) MessageElementFlag::LowercaseLink, textColor)
->setLink(link); ->setLink(link);
this->emplace<TextElement>(string, MessageElementFlag::OriginalLink, auto linkMEOriginal = this->emplace<TextElement>(string,
textColor) MessageElementFlag::OriginalLink, textColor)
->setLink(link); ->setLink(link);
LinkResolver::getLinkInfo( LinkResolver::getLinkInfo(
linkString, [linkMessageElement](QString tooltipText) { linkString, [linkMELowercase, linkMEOriginal](QString tooltipText) {
if (!tooltipText.isEmpty()) { if (!tooltipText.isEmpty()) {
linkMessageElement->setTooltip(tooltipText); linkMELowercase->setTooltip(tooltipText);
linkMEOriginal->setTooltip(tooltipText);
} }
}); });
} }