diff --git a/td/telegram/BackgroundType.cpp b/td/telegram/BackgroundType.cpp index 4546d7477..816f9958a 100644 --- a/td/telegram/BackgroundType.cpp +++ b/td/telegram/BackgroundType.cpp @@ -238,6 +238,11 @@ bool operator==(const BackgroundFill &lhs, const BackgroundFill &rhs) { lhs.fourth_color_ == rhs.fourth_color_; } +StringBuilder &operator<<(StringBuilder &string_builder, const BackgroundFill &fill) { + return string_builder << "BackgroundFill[" << fill.top_color_ << '~' << fill.bottom_color_ << '~' << fill.third_color_ + << '~' << fill.fourth_color_ << ':' << fill.rotation_angle_ << ']'; +} + string BackgroundType::get_mime_type() const { CHECK(has_file()); return type_ == Type::Pattern ? "image/png" : "image/jpeg"; @@ -340,6 +345,8 @@ StringBuilder &operator<<(StringBuilder &string_builder, const BackgroundType &t UNREACHABLE(); break; } + // string_builder << ' ' << type.is_blurred_ << ' ' << type.is_moving_ << ' ' << type.intensity_ << ' ' << type.fill_ + // << ' ' << type.theme_name_ << ' '; return string_builder << '[' << type.get_link() << ']'; } diff --git a/td/telegram/BackgroundType.h b/td/telegram/BackgroundType.h index 0b121ca57..494aae353 100644 --- a/td/telegram/BackgroundType.h +++ b/td/telegram/BackgroundType.h @@ -54,6 +54,8 @@ class BackgroundFill { friend bool operator==(const BackgroundFill &lhs, const BackgroundFill &rhs); + friend StringBuilder &operator<<(StringBuilder &string_builder, const BackgroundFill &fill); + friend class BackgroundType; static Result get_background_fill(Slice name); @@ -63,6 +65,8 @@ class BackgroundFill { bool operator==(const BackgroundFill &lhs, const BackgroundFill &rhs); +StringBuilder &operator<<(StringBuilder &string_builder, const BackgroundFill &fill); + class BackgroundType { enum class Type : int32 { Wallpaper, Pattern, Fill, ChatTheme }; Type type_ = Type::Fill;