mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Added additional request of special sticker pack on failing view pack.
This commit is contained in:
parent
3cc92e01fe
commit
f749616dd8
2 changed files with 28 additions and 5 deletions
|
@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
*/
|
*/
|
||||||
#include "chat_helpers/stickers_list_widget.h"
|
#include "chat_helpers/stickers_list_widget.h"
|
||||||
|
|
||||||
|
#include "base/timer_rpl.h"
|
||||||
#include "core/application.h"
|
#include "core/application.h"
|
||||||
#include "data/data_document.h"
|
#include "data/data_document.h"
|
||||||
#include "data/data_document_media.h"
|
#include "data/data_document_media.h"
|
||||||
|
@ -1717,12 +1718,32 @@ QPoint StickersListWidget::buttonRippleTopLeft(int section) const {
|
||||||
+ st().removeSet.rippleAreaPosition;
|
+ st().removeSet.rippleAreaPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StickersListWidget::showStickerSetBox(not_null<DocumentData*> document) {
|
void StickersListWidget::showStickerSetBox(
|
||||||
|
not_null<DocumentData*> document,
|
||||||
|
uint64 setId) {
|
||||||
if (document->sticker() && document->sticker()->set) {
|
if (document->sticker() && document->sticker()->set) {
|
||||||
checkHideWithBox(Box<StickerSetBox>(
|
checkHideWithBox(Box<StickerSetBox>(
|
||||||
_show,
|
_show,
|
||||||
document->sticker()->set,
|
document->sticker()->set,
|
||||||
document->sticker()->setType));
|
document->sticker()->setType));
|
||||||
|
} else if ((setId == Data::Stickers::FavedSetId)
|
||||||
|
|| (setId == Data::Stickers::RecentSetId)) {
|
||||||
|
const auto lifetime = std::make_shared<rpl::lifetime>();
|
||||||
|
constexpr auto kTimeout = 10000;
|
||||||
|
rpl::merge(
|
||||||
|
base::timer_once(kTimeout),
|
||||||
|
document->owner().stickers().updated(
|
||||||
|
Data::StickersType::Stickers)
|
||||||
|
) | rpl::start_with_next([=, weak = Ui::MakeWeak(this)] {
|
||||||
|
if (weak.get()) {
|
||||||
|
showStickerSetBox(document, setId);
|
||||||
|
}
|
||||||
|
lifetime->destroy();
|
||||||
|
}, *lifetime);
|
||||||
|
document->owner().session().api().requestSpecialStickersForce(
|
||||||
|
setId == Data::Stickers::FavedSetId,
|
||||||
|
setId == Data::Stickers::RecentSetId,
|
||||||
|
false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1779,8 +1800,8 @@ base::unique_qptr<Ui::PopupMenu> StickersListWidget::fillContextMenu(
|
||||||
isFaved ? &icons->menuUnfave : &icons->menuFave);
|
isFaved ? &icons->menuUnfave : &icons->menuFave);
|
||||||
|
|
||||||
if (_features.openStickerSets) {
|
if (_features.openStickerSets) {
|
||||||
menu->addAction(tr::lng_context_pack_info(tr::now), [=] {
|
menu->addAction(tr::lng_context_pack_info(tr::now), [=, id = set.id] {
|
||||||
showStickerSetBox(document);
|
showStickerSetBox(document, id);
|
||||||
}, &icons->menuStickerSet);
|
}, &icons->menuStickerSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1850,7 +1871,7 @@ void StickersListWidget::mouseReleaseEvent(QMouseEvent *e) {
|
||||||
const auto document = set.stickers[sticker->index].document;
|
const auto document = set.stickers[sticker->index].document;
|
||||||
if (_features.openStickerSets
|
if (_features.openStickerSets
|
||||||
&& (e->modifiers() & Qt::ControlModifier)) {
|
&& (e->modifiers() & Qt::ControlModifier)) {
|
||||||
showStickerSetBox(document);
|
showStickerSetBox(document, set.id);
|
||||||
} else {
|
} else {
|
||||||
_chosen.fire({
|
_chosen.fire({
|
||||||
.document = document,
|
.document = document,
|
||||||
|
|
|
@ -350,7 +350,9 @@ private:
|
||||||
void refreshFooterIcons();
|
void refreshFooterIcons();
|
||||||
void refreshIcons(ValidateIconAnimations animations);
|
void refreshIcons(ValidateIconAnimations animations);
|
||||||
|
|
||||||
void showStickerSetBox(not_null<DocumentData*> document);
|
void showStickerSetBox(
|
||||||
|
not_null<DocumentData*> document,
|
||||||
|
uint64 setId);
|
||||||
|
|
||||||
void cancelSetsSearch();
|
void cancelSetsSearch();
|
||||||
void showSearchResults();
|
void showSearchResults();
|
||||||
|
|
Loading…
Add table
Reference in a new issue