2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

API scheme updated to layer 68.

This commit is contained in:
John Preston
2017-06-04 14:09:29 +03:00
parent 8ae159dd66
commit 330b4a0b00
23 changed files with 392 additions and 267 deletions

View File

@@ -822,12 +822,20 @@ for restype in typesList:
for childName in parentFlagsList:
parentName = parentFlags[childName];
for flag in parentFlagsCheck[childName]:
if (not flag in parentFlagsCheck[parentName]):
print('Flag ' + flag + ' not found in ' + parentName + ' which should be a flags-parent of ' + childName);
error
elif (parentFlagsCheck[childName][flag] != parentFlagsCheck[parentName][flag]):
print('Flag ' + flag + ' has different value in ' + parentName + ' which should be a flags-parent of ' + childName);
error
#
# 'channelForbidden' has 'until_date' flag and 'channel' doesn't have it.
# But as long as flags don't collide this is not a problem.
#
# if (not flag in parentFlagsCheck[parentName]):
# print('Flag ' + flag + ' not found in ' + parentName + ' which should be a flags-parent of ' + childName);
# error
#
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
else:
parentFlagsCheck[parentName][flag] = parentFlagsCheck[childName][flag];
inlineMethods += 'inline ' + parentName + '::Flags mtpCastFlags(' + childName + '::Flags flags) { return ' + parentName + '::Flags(QFlag(flags)); }\n';
inlineMethods += 'inline ' + parentName + '::Flags mtpCastFlags(MTPflags<' + childName + '::Flags> flags) { return mtpCastFlags(flags.v); }\n';