Improve logging of unsupported SVG paths.
This commit is contained in:
parent
de0a2a03e5
commit
2bc3d7424b
@ -1337,7 +1337,8 @@ tl_object_ptr<td_api::MaskPoint> StickersManager::get_mask_point_object(int32 po
|
||||
}
|
||||
}
|
||||
|
||||
vector<td_api::object_ptr<td_api::closedVectorPath>> StickersManager::get_sticker_minithumbnail(CSlice path) {
|
||||
vector<td_api::object_ptr<td_api::closedVectorPath>> StickersManager::get_sticker_minithumbnail(
|
||||
CSlice path, StickerSetId sticker_set_id) {
|
||||
if (path.empty()) {
|
||||
return {};
|
||||
}
|
||||
@ -1431,7 +1432,7 @@ vector<td_api::object_ptr<td_api::closedVectorPath>> StickersManager::get_sticke
|
||||
while (!is_closed) {
|
||||
skip_commas();
|
||||
if (path[pos] == '\0') {
|
||||
LOG(ERROR) << "Receive unclosed path " << path;
|
||||
LOG(ERROR) << "Receive unclosed path " << path << " in a sticker from " << sticker_set_id;
|
||||
return {};
|
||||
}
|
||||
if (is_alpha(path[pos])) {
|
||||
@ -1518,7 +1519,8 @@ vector<td_api::object_ptr<td_api::closedVectorPath>> StickersManager::get_sticke
|
||||
is_closed = true;
|
||||
break;
|
||||
default:
|
||||
LOG(ERROR) << "Receive invalid command " << command << " at pos " << pos << " in " << path;
|
||||
LOG(ERROR) << "Receive invalid command " << command << " at pos " << pos << " in a sticker from "
|
||||
<< sticker_set_id << ": " << path;
|
||||
return {};
|
||||
}
|
||||
}
|
||||
@ -1600,8 +1602,8 @@ tl_object_ptr<td_api::sticker> StickersManager::get_sticker_object(FileId file_i
|
||||
auto thumbnail_object = get_thumbnail_object(td_->file_manager_.get(), thumbnail, thumbnail_format);
|
||||
return make_tl_object<td_api::sticker>(sticker->set_id.get(), sticker->dimensions.width, sticker->dimensions.height,
|
||||
sticker->alt, sticker->is_animated, sticker->is_mask, std::move(mask_position),
|
||||
get_sticker_minithumbnail(sticker->minithumbnail), std::move(thumbnail_object),
|
||||
td_->file_manager_->get_file_object(file_id));
|
||||
get_sticker_minithumbnail(sticker->minithumbnail, sticker->set_id),
|
||||
std::move(thumbnail_object), td_->file_manager_->get_file_object(file_id));
|
||||
}
|
||||
|
||||
tl_object_ptr<td_api::stickers> StickersManager::get_stickers_object(const vector<FileId> &sticker_ids) const {
|
||||
@ -1705,9 +1707,9 @@ tl_object_ptr<td_api::stickerSet> StickersManager::get_sticker_set_object(Sticke
|
||||
sticker_set->is_animated ? PhotoFormat::Tgs : PhotoFormat::Webp);
|
||||
return make_tl_object<td_api::stickerSet>(
|
||||
sticker_set->id.get(), sticker_set->title, sticker_set->short_name, std::move(thumbnail),
|
||||
get_sticker_minithumbnail(sticker_set->minithumbnail), sticker_set->is_installed && !sticker_set->is_archived,
|
||||
sticker_set->is_archived, sticker_set->is_official, sticker_set->is_animated, sticker_set->is_masks,
|
||||
sticker_set->is_viewed, std::move(stickers), std::move(emojis));
|
||||
get_sticker_minithumbnail(sticker_set->minithumbnail, sticker_set->id),
|
||||
sticker_set->is_installed && !sticker_set->is_archived, sticker_set->is_archived, sticker_set->is_official,
|
||||
sticker_set->is_animated, sticker_set->is_masks, sticker_set->is_viewed, std::move(stickers), std::move(emojis));
|
||||
}
|
||||
|
||||
tl_object_ptr<td_api::stickerSets> StickersManager::get_sticker_sets_object(int32 total_count,
|
||||
@ -1751,9 +1753,9 @@ tl_object_ptr<td_api::stickerSetInfo> StickersManager::get_sticker_set_info_obje
|
||||
sticker_set->is_animated ? PhotoFormat::Tgs : PhotoFormat::Webp);
|
||||
return make_tl_object<td_api::stickerSetInfo>(
|
||||
sticker_set->id.get(), sticker_set->title, sticker_set->short_name, std::move(thumbnail),
|
||||
get_sticker_minithumbnail(sticker_set->minithumbnail), sticker_set->is_installed && !sticker_set->is_archived,
|
||||
sticker_set->is_archived, sticker_set->is_official, sticker_set->is_animated, sticker_set->is_masks,
|
||||
sticker_set->is_viewed,
|
||||
get_sticker_minithumbnail(sticker_set->minithumbnail, sticker_set->id),
|
||||
sticker_set->is_installed && !sticker_set->is_archived, sticker_set->is_archived, sticker_set->is_official,
|
||||
sticker_set->is_animated, sticker_set->is_masks, sticker_set->is_viewed,
|
||||
sticker_set->was_loaded ? narrow_cast<int32>(sticker_set->sticker_ids.size()) : sticker_set->sticker_count,
|
||||
std::move(stickers));
|
||||
}
|
||||
|
@ -394,7 +394,8 @@ class StickersManager : public Actor {
|
||||
|
||||
class UploadStickerFileCallback;
|
||||
|
||||
static vector<td_api::object_ptr<td_api::closedVectorPath>> get_sticker_minithumbnail(CSlice path);
|
||||
static vector<td_api::object_ptr<td_api::closedVectorPath>> get_sticker_minithumbnail(CSlice path,
|
||||
StickerSetId sticker_set_id);
|
||||
|
||||
static tl_object_ptr<td_api::MaskPoint> get_mask_point_object(int32 point);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user