2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Support common error for the whole value.

It is removed (considered fixed) if anything changes in the data.
This commit is contained in:
John Preston
2018-08-14 14:37:03 +03:00
parent cb827406ca
commit b935d54fe7
11 changed files with 328 additions and 130 deletions

View File

@@ -164,10 +164,14 @@ struct Value {
Email,
};
explicit Value(Type type);
Value(Value &&other) = default;
Value &operator=(Value &&other) = default;
// Some data is not parsed from server-provided values.
// It should be preserved through re-parsing (for example when saving).
// So we hide "operator=(Value&&)" in private and instead provide this.
void fillDataFrom(Value &&other);
bool requiresSpecialScan(SpecialFile type) const;
bool scansAreFilled() const;
@@ -188,10 +192,13 @@ struct Value {
bool selfieRequired = false;
bool translationRequired = false;
bool nativeNames = false;
int editScreens = 0;
mtpRequestId saveRequestId = 0;
private:
Value &operator=(Value &&other) = default;
};
struct RequestedValue {
@@ -395,9 +402,9 @@ private:
bytes::const_span passwordBytes,
uint64 serverSecretId);
void decryptValues();
void decryptValue(Value &value);
bool validateValueSecrets(Value &value);
void resetValue(Value &value);
void decryptValue(Value &value) const;
bool validateValueSecrets(Value &value) const;
void resetValue(Value &value) const;
void fillErrors();
void loadFile(File &file);