Try to optimize sticker set handling (less reload)
This commit is contained in:
parent
932f483b7a
commit
60c1ed6bb1
2 changed files with 3 additions and 3 deletions
|
@ -178,9 +178,8 @@ Page {
|
|||
updateGroupStatusText();
|
||||
}
|
||||
if (stickerManager.needsReload()) {
|
||||
Debug.log("[ChatPage] Stickers will be reloaded!");
|
||||
Debug.log("[ChatPage] Recent stickers will be reloaded!");
|
||||
tdLibWrapper.getRecentStickers();
|
||||
tdLibWrapper.getInstalledStickerSets();
|
||||
stickerManager.setNeedsReload(false);
|
||||
}
|
||||
tdLibWrapper.getChatPinnedMessage(chatInformation.id);
|
||||
|
@ -1448,6 +1447,7 @@ Page {
|
|||
target: stickerPickerLoader.item
|
||||
onStickerPicked: {
|
||||
Debug.log("Sticker picked: " + stickerId);
|
||||
stickerManager.setNeedsReload(true);
|
||||
tdLibWrapper.sendStickerMessage(chatInformation.id, stickerId, newMessageColumn.replyToMessageId);
|
||||
stickerPickerLoader.active = false;
|
||||
attachmentOptionsFlickable.isNeeded = false;
|
||||
|
|
|
@ -27,6 +27,7 @@ StickerManager::StickerManager(TDLibWrapper *tdLibWrapper, QObject *parent) : QO
|
|||
{
|
||||
LOG("Initializing...");
|
||||
this->tdLibWrapper = tdLibWrapper;
|
||||
this->reloadNeeded = false;
|
||||
|
||||
connect(this->tdLibWrapper, SIGNAL(recentStickersUpdated(QVariantList)), this, SLOT(handleRecentStickersUpdated(QVariantList)));
|
||||
connect(this->tdLibWrapper, SIGNAL(stickersReceived(QVariantList)), this, SLOT(handleStickersReceived(QVariantList)));
|
||||
|
@ -157,7 +158,6 @@ void StickerManager::handleStickerSetReceived(const QVariantMap &stickerSet)
|
|||
QVariantMap thumbnailLocalFile = thumbnailFile.value("local").toMap();
|
||||
if (!thumbnailLocalFile.value("is_downloading_completed").toBool()) {
|
||||
tdLibWrapper->downloadFile(thumbnailFile.value("id").toInt());
|
||||
this->reloadNeeded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue