Exclude trending stickers from getStickers.

GitOrigin-RevId: 52655e51077a48ac2bea6320f2c4be0aa5c18127
This commit is contained in:
levlam 2018-03-17 20:24:21 +03:00
parent 6a943c0b78
commit 88d5e5e015
3 changed files with 7 additions and 5 deletions

View File

@ -2503,10 +2503,10 @@ clearImportedContacts = Ok;
getUserProfilePhotos user_id:int32 offset:int32 limit:int32 = UserProfilePhotos;
//@description Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is not empty, favorite, recently used and trending stickers may also be returned @emoji String representation of emoji. If empty, returns all known installed stickers @limit Maximum number of stickers to be returned
//@description Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is not empty, favorite and recently used stickers may also be returned @emoji String representation of emoji. If empty, returns all known installed stickers @limit Maximum number of stickers to be returned
getStickers emoji:string limit:int32 = Stickers;
//@description Searches for stickers from public sticker sets that correspond to a given emoji. May exclude some stickers returned by getStickers from the results @emoji String representation of emoji; must be non-empty @limit Maximum number of stickers to be returned
//@description Searches for stickers from public sticker sets that correspond to a given emoji @emoji String representation of emoji; must be non-empty @limit Maximum number of stickers to be returned
searchStickers emoji:string limit:int32 = Stickers;
//@description Returns a list of installed sticker sets @is_masks Pass true to return mask sticker sets; pass false to return ordinary sticker sets

View File

@ -79,7 +79,7 @@ class SearchStickersQuery : public Td::ResultHandler {
public:
void send(string emoji) {
emoji_ = std::move(emoji);
int32 flags = telegram_api::messages_getStickers::EXCLUDE_FEATURED_MASK;
int32 flags = 0;
send_query(G()->net_query_creator().create(
create_storer(telegram_api::messages_getStickers(flags, false /*ignored*/, emoji_, ""))));
}
@ -1761,10 +1761,12 @@ vector<FileId> StickersManager::get_stickers(string emoji, int32 limit, bool for
load_favorite_stickers(std::move(promise));
return {};
}
/*
if (!are_featured_sticker_sets_loaded_) {
load_featured_sticker_sets(std::move(promise));
return {};
}
*/
}
vector<int64> sets_to_load;
@ -1837,7 +1839,7 @@ vector<FileId> StickersManager::get_stickers(string emoji, int32 limit, bool for
}
}
} else {
vector<int64> examined_sticker_set_ids = featured_sticker_set_ids_;
vector<int64> examined_sticker_set_ids; // = featured_sticker_set_ids_;
for (const auto &sticker_set_id : installed_sticker_set_ids_[0]) {
if (std::find(examined_sticker_set_ids.begin(), examined_sticker_set_ids.end(), sticker_set_id) ==
examined_sticker_set_ids.end()) {

View File

@ -2775,7 +2775,7 @@ class GetStickersRequest : public RequestActor<> {
public:
GetStickersRequest(ActorShared<Td> td, uint64 request_id, string &&emoji, int32 limit)
: RequestActor(std::move(td), request_id), emoji_(std::move(emoji)), limit_(limit) {
set_tries(6);
set_tries(5);
}
};