Skip to content

Commit 44a6f92

Browse files
committed
Replace empty top_hours_graph.
1 parent 3b47a28 commit 44a6f92

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

td/generate/tl_writer_td.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ bool TD_TL_writer::is_full_constructor_generated(const tl::tl_combinator *t, boo
6464
t->name == "langPackString" || t->name == "langPackStringPluralized" || t->name == "langPackStringDeleted" ||
6565
t->name == "peerUser" || t->name == "peerChat" || t->name == "updateServiceNotification" ||
6666
t->name == "updateNewMessage" || t->name == "updateChannelTooLong" || t->name == "messages.stickerSet" ||
67-
t->name == "updates.differenceSlice" || t->name == "contacts.contactBirthdays";
67+
t->name == "updates.differenceSlice" || t->name == "contacts.contactBirthdays" || t->name == "statsGraphError";
6868
}
6969

7070
int TD_TL_writer::get_storer_type(const tl::tl_combinator *t, const std::string &storer_name) const {

td/telegram/StatisticsManager.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,10 @@ class GetDialogRevenueStatsQuery final : public Td::ResultHandler {
315315
auto ptr = result_ptr.move_as_ok();
316316
LOG(DEBUG) << "Receive result for GetDialogRevenueStatsQuery: " << to_string(ptr);
317317
if (ptr->top_hours_graph_ == nullptr) {
318-
LOG(ERROR) << "Receive " << to_string(ptr);
319-
return on_error(Status::Error(500, "Receive invalid response"));
318+
auto error = ptr->revenue_graph_->get_id() == telegram_api::statsGraphError::ID
319+
? static_cast<const telegram_api::statsGraphError *>(ptr->revenue_graph_.get())->error_
320+
: string("Not enough data to display.");
321+
ptr->top_hours_graph_ = telegram_api::make_object<telegram_api::statsGraphError>(error);
320322
}
321323
promise_.set_value(convert_ton_revenue_stats(std::move(ptr)));
322324
}

0 commit comments

Comments
 (0)