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:
committed by
Tobias Fella
parent
c2580c1d2d
commit
5b23593fd2
@@ -96,10 +96,10 @@ void AccountEmoticonModel::setConnection(Connection *connection)
|
|||||||
|
|
||||||
void AccountEmoticonModel::reloadEmoticons()
|
void AccountEmoticonModel::reloadEmoticons()
|
||||||
{
|
{
|
||||||
if (!m_connection->hasAccountData("im.ponies.user_emotes"_ls)) {
|
QJsonObject json;
|
||||||
return;
|
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);
|
const auto &content = ImagePackEventContent(json);
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
m_images = content;
|
m_images = content;
|
||||||
|
|||||||
Reference in New Issue
Block a user