fix: add more image sizes to shared chat badge (#6146)

This commit is contained in:
nerix
2025-04-13 11:48:13 +02:00
committed by GitHub
parent f56b7c05bf
commit e1863d64ee
5 changed files with 73 additions and 5 deletions
+28
View File
@@ -438,4 +438,32 @@ bool readProviderEmotesCache(const QString &id, const QString &provider,
return false;
}
std::pair<QStringView, QStringView> splitOnce(QStringView haystack,
QStringView needle) noexcept
{
auto idx = haystack.indexOf(needle);
if (idx < 0)
{
return {haystack, {}};
}
return {
haystack.sliced(0, idx),
haystack.sliced(idx + needle.size()),
};
}
std::pair<QStringView, QStringView> splitOnce(QStringView haystack,
QChar needle) noexcept
{
auto idx = haystack.indexOf(needle);
if (idx < 0)
{
return {haystack, {}};
}
return {
haystack.sliced(0, idx),
haystack.sliced(idx + 1),
};
}
} // namespace chatterino