mirror of
https://github.com/vale981/tdesktop
synced 2025-03-06 02:01:40 -05:00
Allow Vector<bytes> in scheme.
This commit is contained in:
parent
d6d942bc64
commit
46af87a00a
3 changed files with 28 additions and 22 deletions
|
@ -1064,7 +1064,6 @@ account.resetWebAuthorizations#682d2594 = Bool;
|
|||
account.getSecureValue#73665bc2 types:Vector<SecureValueType> = Vector<SecureValue>;
|
||||
account.saveSecureValue#899fe31d value:InputSecureValue secure_secret_id:long = SecureValue;
|
||||
account.deleteSecureValue#b880bc4b types:Vector<SecureValueType> = Bool;
|
||||
account.setSecureValueErrors#d0093ce4 user_id:InputUser errors:Vector<SecureValueError> = Bool;
|
||||
account.getAuthorizationForm#b86ba8e1 bot_id:int scope:string public_key:string = account.AuthorizationForm;
|
||||
account.acceptAuthorization#e7027c94 bot_id:int scope:string public_key:string value_hashes:Vector<SecureValueHash> credentials:SecureCredentialsEncrypted = Bool;
|
||||
account.sendVerifyPhoneCode#823380b4 flags:# allow_flashcall:flags.0?true phone_number:string current_number:flags.0?Bool = auth.SentCode;
|
||||
|
@ -1074,6 +1073,7 @@ account.verifyEmail#ecba39db email:string code:string = Bool;
|
|||
|
||||
users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
|
||||
users.getFullUser#ca30a5b1 id:InputUser = UserFull;
|
||||
users.setSecureValueErrors#90c894b5 id:InputUser errors:Vector<SecureValueError> = Bool;
|
||||
|
||||
contacts.getStatuses#c4a353ee = Vector<ContactStatus>;
|
||||
contacts.getContacts#c023849f hash:int = contacts.Contacts;
|
||||
|
|
|
@ -115,6 +115,7 @@ for line in lines:
|
|||
if (not nametype):
|
||||
if (not re.match(r'vector#1cb5c415 \{t:Type\} # \[ t \] = Vector t;', line)):
|
||||
print('Bad line found: ' + line);
|
||||
sys.exit(1);
|
||||
continue;
|
||||
|
||||
name = nametype.group(1);
|
||||
|
@ -161,7 +162,7 @@ for line in lines:
|
|||
vectemplate = templ.group(2);
|
||||
if (re.match(r'^[A-Z]', vectemplate) or re.match(r'^[a-zA-Z0-9]+_[A-Z]', vectemplate)):
|
||||
restype = templ.group(1) + 'MTP' + vectemplate.replace('.', '_') + '>';
|
||||
elif (vectemplate == 'int' or vectemplate == 'long' or vectemplate == 'string'):
|
||||
elif (vectemplate == 'int' or vectemplate == 'long' or vectemplate == 'string' or vectemplate == 'bytes'):
|
||||
restype = templ.group(1) + 'MTP' + vectemplate.replace('.', '_') + '>';
|
||||
else:
|
||||
foundmeta = '';
|
||||
|
@ -176,10 +177,10 @@ for line in lines:
|
|||
ptype = templ.group(1) + 'MTP' + foundmeta.replace('.', '_') + '>';
|
||||
else:
|
||||
print('Bad vector param: ' + vectemplate);
|
||||
continue;
|
||||
sys.exit(1);
|
||||
else:
|
||||
print('Bad template type: ' + restype);
|
||||
continue;
|
||||
sys.exit(1);
|
||||
resType = restype.replace('.', '_');
|
||||
if (restype.find('.') >= 0):
|
||||
parts = re.match(r'([a-z]+)\.([A-Z][A-Za-z0-9<>\._]+)', restype)
|
||||
|
@ -187,13 +188,13 @@ for line in lines:
|
|||
restype = parts.group(1) + '_' + parts.group(2)[0:1].lower() + parts.group(2)[1:];
|
||||
else:
|
||||
print('Bad result type name with dot: ' + restype);
|
||||
continue;
|
||||
sys.exit(1);
|
||||
else:
|
||||
if (re.match(r'^[A-Z]', restype)):
|
||||
restype = restype[:1].lower() + restype[1:];
|
||||
else:
|
||||
print('Bad result type name: ' + restype);
|
||||
continue;
|
||||
sys.exit(1);
|
||||
|
||||
boxed[resType] = restype;
|
||||
boxed[Name] = name;
|
||||
|
@ -217,7 +218,7 @@ for line in lines:
|
|||
pnametype = re.match(r'([a-z_][a-z0-9_]*):([A-Za-z0-9<>\._]+|![a-zA-Z]+|\#|[a-z_][a-z0-9_]*\.[0-9]+\?[A-Za-z0-9<>\._]+)$', param);
|
||||
if (not pnametype):
|
||||
print('Bad param found: "' + param + '" in line: ' + line);
|
||||
continue;
|
||||
sys.exit(1);
|
||||
pname = pnametype.group(1);
|
||||
ptypewide = pnametype.group(2);
|
||||
if (re.match(r'^!([a-zA-Z]+)$', ptypewide)):
|
||||
|
@ -226,7 +227,7 @@ for line in lines:
|
|||
ptype = 'TQueryType';
|
||||
else:
|
||||
print('Bad template param name: "' + param + '" in line: ' + line);
|
||||
continue;
|
||||
sys.exit(1);
|
||||
elif (ptypewide == '#'):
|
||||
hasFlags = pname;
|
||||
if funcsNow:
|
||||
|
@ -239,7 +240,7 @@ for line in lines:
|
|||
pmasktype = re.match(r'([a-z_][a-z0-9_]*)\.([0-9]+)\?([A-Za-z0-9<>\._]+)', ptype);
|
||||
if (not pmasktype or pmasktype.group(1) != hasFlags):
|
||||
print('Bad param found: "' + param + '" in line: ' + line);
|
||||
continue;
|
||||
sys.exit(1);
|
||||
ptype = pmasktype.group(3);
|
||||
if (ptype.find('<') >= 0):
|
||||
templ = re.match(r'^([vV]ector<)([A-Za-z0-9\._]+)>$', ptype);
|
||||
|
@ -247,7 +248,7 @@ for line in lines:
|
|||
vectemplate = templ.group(2);
|
||||
if (re.match(r'^[A-Z]', vectemplate) or re.match(r'^[a-zA-Z0-9]+_[A-Z]', vectemplate)):
|
||||
ptype = templ.group(1) + 'MTP' + vectemplate.replace('.', '_') + '>';
|
||||
elif (vectemplate == 'int' or vectemplate == 'long' or vectemplate == 'string'):
|
||||
elif (vectemplate == 'int' or vectemplate == 'long' or vectemplate == 'string' or vectemplate == 'bytes'):
|
||||
ptype = templ.group(1) + 'MTP' + vectemplate.replace('.', '_') + '>';
|
||||
else:
|
||||
foundmeta = '';
|
||||
|
@ -262,10 +263,10 @@ for line in lines:
|
|||
ptype = templ.group(1) + 'MTP' + foundmeta.replace('.', '_') + '>';
|
||||
else:
|
||||
print('Bad vector param: ' + vectemplate);
|
||||
continue;
|
||||
sys.exit(1);
|
||||
else:
|
||||
print('Bad template type: ' + ptype);
|
||||
continue;
|
||||
sys.exit(1);
|
||||
if (not pname in conditions):
|
||||
conditionsList.append(pname);
|
||||
conditions[pname] = pmasktype.group(2);
|
||||
|
@ -277,7 +278,7 @@ for line in lines:
|
|||
vectemplate = templ.group(2);
|
||||
if (re.match(r'^[A-Z]', vectemplate) or re.match(r'^[a-zA-Z0-9]+_[A-Z]', vectemplate)):
|
||||
ptype = templ.group(1) + 'MTP' + vectemplate.replace('.', '_') + '>';
|
||||
elif (vectemplate == 'int' or vectemplate == 'long' or vectemplate == 'string'):
|
||||
elif (vectemplate == 'int' or vectemplate == 'long' or vectemplate == 'string' or vectemplate == 'bytes'):
|
||||
ptype = templ.group(1) + 'MTP' + vectemplate.replace('.', '_') + '>';
|
||||
else:
|
||||
foundmeta = '';
|
||||
|
@ -292,16 +293,16 @@ for line in lines:
|
|||
ptype = templ.group(1) + 'MTP' + foundmeta.replace('.', '_') + '>';
|
||||
else:
|
||||
print('Bad vector param: ' + vectemplate);
|
||||
continue;
|
||||
sys.exit(1);
|
||||
else:
|
||||
print('Bad template type: ' + ptype);
|
||||
continue;
|
||||
sys.exit(1);
|
||||
prmsList.append(pname);
|
||||
prms[pname] = ptype.replace('.', '_');
|
||||
|
||||
if (isTemplate == '' and resType == 'X'):
|
||||
print('Bad response type "X" in "' + name +'" in line: ' + line);
|
||||
continue;
|
||||
sys.exit(1);
|
||||
|
||||
if funcsNow:
|
||||
methodBodies = ''
|
||||
|
@ -851,12 +852,12 @@ for childName in parentFlagsList:
|
|||
#
|
||||
# if (not flag in parentFlagsCheck[parentName]):
|
||||
# print('Flag ' + flag + ' not found in ' + parentName + ' which should be a flags-parent of ' + childName);
|
||||
# error
|
||||
# sys.exit(1);
|
||||
#
|
||||
if (flag in parentFlagsCheck[parentName]):
|
||||
if (parentFlagsCheck[childName][flag] != parentFlagsCheck[parentName][flag]):
|
||||
print('Flag ' + flag + ' has different value in ' + parentName + ' which should be a flags-parent of ' + childName);
|
||||
error
|
||||
sys.exit(1);
|
||||
else:
|
||||
parentFlagsCheck[parentName][flag] = parentFlagsCheck[childName][flag];
|
||||
flagOperators += 'inline ' + parentName + '::Flags mtpCastFlags(' + childName + '::Flags flags) { return static_cast<' + parentName + '::Flag>(flags.value()); }\n';
|
||||
|
|
|
@ -229,10 +229,11 @@ base::optional<int> EditScans::validateGetErrorTop() {
|
|||
[](const ScanInfo &file) { return !file.error.isEmpty(); }
|
||||
) != end(_files);
|
||||
|
||||
auto result = base::optional<int>();
|
||||
if (!exists
|
||||
|| ((errorExists || _uploadMoreError) && !uploadedSomeMore())) {
|
||||
toggleError(true);
|
||||
return (_files.size() > 5) ? _upload->y() : _header->y();
|
||||
result = (_files.size() > 5) ? _upload->y() : _header->y();
|
||||
}
|
||||
|
||||
const auto nonDeletedErrorIt = ranges::find_if(
|
||||
|
@ -243,16 +244,20 @@ base::optional<int> EditScans::validateGetErrorTop() {
|
|||
if (nonDeletedErrorIt != end(_files)) {
|
||||
const auto index = (nonDeletedErrorIt - begin(_files));
|
||||
toggleError(true);
|
||||
return _rows[index]->y();
|
||||
if (!result) {
|
||||
result = _rows[index]->y();
|
||||
}
|
||||
}
|
||||
if (_selfie
|
||||
&& (!_selfie->key.id
|
||||
|| _selfie->deleted
|
||||
|| !_selfie->error.isEmpty())) {
|
||||
toggleSelfieError(true);
|
||||
return _selfieHeader->y();
|
||||
if (!result) {
|
||||
result = _selfieHeader->y();
|
||||
}
|
||||
}
|
||||
return base::none;
|
||||
return result;
|
||||
}
|
||||
|
||||
void EditScans::setupContent(const QString &header) {
|
||||
|
|
Loading…
Add table
Reference in a new issue