Add CustomEmojiId::get_custom_emoji_ids.
This commit is contained in:
parent
881e74accb
commit
46a76fa9a8
@ -41,6 +41,15 @@ class CustomEmojiId {
|
|||||||
return id != other.id;
|
return id != other.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static vector<CustomEmojiId> get_custom_emoji_ids(const vector<int64> &document_ids) {
|
||||||
|
vector<CustomEmojiId> custom_emoji_ids;
|
||||||
|
custom_emoji_ids.reserve(document_ids.size());
|
||||||
|
for (auto &document_id : document_ids) {
|
||||||
|
custom_emoji_ids.emplace_back(document_id);
|
||||||
|
}
|
||||||
|
return custom_emoji_ids;
|
||||||
|
}
|
||||||
|
|
||||||
template <class StorerT>
|
template <class StorerT>
|
||||||
void store(StorerT &storer) const {
|
void store(StorerT &storer) const {
|
||||||
storer.store_long(id);
|
storer.store_long(id);
|
||||||
|
@ -5101,13 +5101,11 @@ void StickersManager::on_find_custom_emojis_success(const string &emoji,
|
|||||||
case telegram_api::emojiList::ID: {
|
case telegram_api::emojiList::ID: {
|
||||||
auto emoji_list = move_tl_object_as<telegram_api::emojiList>(stickers);
|
auto emoji_list = move_tl_object_as<telegram_api::emojiList>(stickers);
|
||||||
|
|
||||||
auto custom_emoji_ids =
|
auto custom_emoji_ids = CustomEmojiId::get_custom_emoji_ids(emoji_list->document_id_);
|
||||||
transform(std::move(emoji_list->document_id_), [](int64 document_id) { return CustomEmojiId(document_id); });
|
|
||||||
auto hash = emoji_list->hash_;
|
|
||||||
|
|
||||||
get_custom_emoji_stickers_unlimited(
|
get_custom_emoji_stickers_unlimited(
|
||||||
custom_emoji_ids, PromiseCreator::lambda([actor_id = actor_id(this), emoji, hash, custom_emoji_ids](
|
custom_emoji_ids,
|
||||||
Result<td_api::object_ptr<td_api::stickers>> &&result) {
|
PromiseCreator::lambda([actor_id = actor_id(this), emoji, hash = emoji_list->hash_,
|
||||||
|
custom_emoji_ids](Result<td_api::object_ptr<td_api::stickers>> &&result) {
|
||||||
send_closure(actor_id, &StickersManager::on_load_custom_emojis, std::move(emoji), hash, custom_emoji_ids,
|
send_closure(actor_id, &StickersManager::on_load_custom_emojis, std::move(emoji), hash, custom_emoji_ids,
|
||||||
std::move(result));
|
std::move(result));
|
||||||
}));
|
}));
|
||||||
@ -6801,8 +6799,7 @@ void StickersManager::on_get_default_dialog_photo_custom_emoji_ids(
|
|||||||
}
|
}
|
||||||
CHECK(constructor_id == telegram_api::emojiList::ID);
|
CHECK(constructor_id == telegram_api::emojiList::ID);
|
||||||
auto emoji_list = move_tl_object_as<telegram_api::emojiList>(emoji_list_ptr);
|
auto emoji_list = move_tl_object_as<telegram_api::emojiList>(emoji_list_ptr);
|
||||||
auto custom_emoji_ids =
|
auto custom_emoji_ids = CustomEmojiId::get_custom_emoji_ids(emoji_list->document_id_);
|
||||||
transform(std::move(emoji_list->document_id_), [](int64 document_id) { return CustomEmojiId(document_id); });
|
|
||||||
auto hash = emoji_list->hash_;
|
auto hash = emoji_list->hash_;
|
||||||
|
|
||||||
if (G()->use_sqlite_pmc()) {
|
if (G()->use_sqlite_pmc()) {
|
||||||
|
@ -7461,9 +7461,8 @@ void Td::on_request(uint64 id, td_api::getEmojiSuggestionsUrl &request) {
|
|||||||
|
|
||||||
void Td::on_request(uint64 id, const td_api::getCustomEmojiStickers &request) {
|
void Td::on_request(uint64 id, const td_api::getCustomEmojiStickers &request) {
|
||||||
CREATE_REQUEST_PROMISE();
|
CREATE_REQUEST_PROMISE();
|
||||||
stickers_manager_->get_custom_emoji_stickers(
|
stickers_manager_->get_custom_emoji_stickers(CustomEmojiId::get_custom_emoji_ids(request.custom_emoji_ids_), true,
|
||||||
transform(request.custom_emoji_ids_, [](int64 custom_emoji_id) { return CustomEmojiId(custom_emoji_id); }), true,
|
std::move(promise));
|
||||||
std::move(promise));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Td::on_request(uint64 id, const td_api::getDefaultChatPhotoCustomEmojiStickers &request) {
|
void Td::on_request(uint64 id, const td_api::getDefaultChatPhotoCustomEmojiStickers &request) {
|
||||||
|
Loading…
Reference in New Issue
Block a user