refactor(linkparser): take string views (#6715)

Reviewed-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
Nerixyz
2026-01-05 23:53:58 +01:00
committed by GitHub
parent 6110c32916
commit 90373323ec
7 changed files with 20 additions and 14 deletions
@@ -143,11 +143,8 @@ bool appendWhisperMessageWordsLocally(const QStringList &words)
b.emplace<EmoteElement>(emote,
MessageElementFlag::EmojiAll);
}
void operator()(QStringView stringView,
MessageBuilder &b) const
void operator()(QStringView string, MessageBuilder &b) const
{
QString string =
stringView.toString(); // FIXME: use string view
auto link = linkparser::parse(string);
if (link)
{
@@ -155,7 +152,7 @@ bool appendWhisperMessageWordsLocally(const QStringList &words)
}
else
{
b.emplace<TextElement>(string,
b.emplace<TextElement>(string.toString(),
MessageElementFlag::Text);
}
}