Let accounts without the emoticon account data to create emojis/stickers

This check worked for accounts that already had custom emojis, but if it
never had any added, m_images was never filled and the model would crash
when adding more.
This commit is contained in:
Joshua Goins
2023-06-08 15:11:17 -04:00
committed by Tobias Fella
parent c2580c1d2d
commit 5b23593fd2

View File

@@ -96,10 +96,10 @@ void AccountEmoticonModel::setConnection(Connection *connection)
void AccountEmoticonModel::reloadEmoticons()
{
if (!m_connection->hasAccountData("im.ponies.user_emotes"_ls)) {
return;
QJsonObject json;
if (m_connection->hasAccountData("im.ponies.user_emotes"_ls)) {
json = m_connection->accountData("im.ponies.user_emotes"_ls)->contentJson();
}
auto json = m_connection->accountData("im.ponies.user_emotes"_ls)->contentJson();
const auto &content = ImagePackEventContent(json);
beginResetModel();
m_images = content;