Skip to content
Snippets Groups Projects
Verified Commit 4002b1ec authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Properly propagate pack usage to UI

We can't have a pack that is neither sticker nor emoji. Which is why
none defaults to both on. That wasn't propagated to the UI, which made
the interaction very confusing. It also made some states unsettable,
since you can't turn anything off from the none state.

fixes #1152
parent 30fde1f8
No related branches found
No related tags found
No related merge requests found
Pipeline #3774 passed
......@@ -248,6 +248,9 @@ SingleImagePackModel::setIsStickerPack(bool val)
using mtx::events::msc2545::PackUsage;
if (val != pack.pack->is_sticker()) {
pack.pack->usage.set(PackUsage::Sticker, val);
if (!val)
pack.pack->usage.set(PackUsage::Emoji, true);
emit isEmotePackChanged();
emit isStickerPackChanged();
}
}
......@@ -258,7 +261,10 @@ SingleImagePackModel::setIsEmotePack(bool val)
using mtx::events::msc2545::PackUsage;
if (val != pack.pack->is_emoji()) {
pack.pack->usage.set(PackUsage::Emoji, val);
if (!val)
pack.pack->usage.set(PackUsage::Sticker, true);
emit isEmotePackChanged();
emit isStickerPackChanged();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment