Make DialogAction fields private.

GitOrigin-RevId: 2d826e7fcf58428dbbf062baddbde01629708475
This commit is contained in:
levlam 2020-10-01 19:35:54 +03:00
parent 8c4a9e7553
commit ad2f6d8168

View File

@ -18,7 +18,6 @@
namespace td {
class DialogAction {
public:
enum class Type : int32 {
Cancel,
Typing,
@ -37,10 +36,15 @@ class DialogAction {
Type type_ = Type::Cancel;
int32 progress_ = 0;
DialogAction() = default;
DialogAction(Type type, int32 progress);
void init(Type type);
void init(Type type, int32 progress);
public:
DialogAction() = default;
explicit DialogAction(tl_object_ptr<td_api::ChatAction> &&action);
explicit DialogAction(tl_object_ptr<telegram_api::SendMessageAction> &&action);
@ -57,14 +61,12 @@ class DialogAction {
static DialogAction get_typing_action();
private:
void init(Type type);
void init(Type type, int32 progress);
};
friend bool operator==(const DialogAction &lhs, const DialogAction &rhs) {
return lhs.type_ == rhs.type_ && lhs.progress_ == rhs.progress_;
}
inline bool operator==(const DialogAction &lhs, const DialogAction &rhs) {
return lhs.type_ == rhs.type_ && lhs.progress_ == rhs.progress_;
}
friend StringBuilder &operator<<(StringBuilder &string_builder, const DialogAction &action);
};
inline bool operator!=(const DialogAction &lhs, const DialogAction &rhs) {
return !(lhs == rhs);