Fix AuthKey storer.

GitOrigin-RevId: 5b3388ec2a924af487bb70aaa24965330663011c
This commit is contained in:
levlam 2018-11-27 05:06:34 +03:00
parent 7d565e359d
commit a091d1d0c4

View File

@ -11,6 +11,7 @@
namespace td { namespace td {
namespace mtproto { namespace mtproto {
class AuthKey { class AuthKey {
public: public:
AuthKey() = default; AuthKey() = default;
@ -54,11 +55,11 @@ class AuthKey {
auth_key_.clear(); auth_key_.clear();
} }
enum { AUTH_FLAG = 1, WAS_AUTH_FLAG = 2 }; enum : int32 { AUTH_FLAG = 1, WAS_AUTH_FLAG = 2 };
template <class StorerT> template <class StorerT>
void store(StorerT &storer) const { void store(StorerT &storer) const {
storer.store_binary(auth_key_id_); storer.store_binary(auth_key_id_);
storer.store_binary((auth_flag_ ? AUTH_FLAG : 0) | (was_auth_flag_ ? WAS_AUTH_FLAG : 0)); storer.store_binary(static_cast<int32>((auth_flag_ ? AUTH_FLAG : 0) | (was_auth_flag_ ? WAS_AUTH_FLAG : 0)));
storer.store_string(auth_key_); storer.store_string(auth_key_);
} }