Skip to content

Commit a2fb04f

Browse files
authored
Update 8.7.4 version (#233)
- sync ID with Layer 140 - remove unused class get_blocked_contacts - added layer_compiled_140.json as a base layer - layers with a large number will be added to compiled one on top in ascending order - deleted old layer files - update files for mock objects - fix styleci - update files for mock objects - fix tests
1 parent 931ca58 commit a2fb04f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+103231
-163593
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "MIT",
66
"type": "library",
77
"require-dev": {
8-
"phpunit/phpunit": "^9.0"
8+
"phpunit/phpunit": "^8.0"
99
},
1010
"require": {
1111
"php": "^7.4",

src/LibConfig.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ class LibConfig
4848

4949
public const APP_DEFAULT_DEVICE_LANG_CODE = 'en-us';
5050
public const APP_DEFAULT_LANG_CODE = 'en';
51-
public const APP_DEFAULT_VERSION = '8.3.2';
51+
public const APP_DEFAULT_VERSION = '8.7.4';
5252
// see https://www.apkmirror.com/apk/telegram-fz-llc/telegram/telegram-6-0-1-release/
5353
// arm64-v8a for android 6+ has 5th digit always "7"
54-
public const APP_DEFAULT_VERSION_CODE = '24967';
54+
public const APP_DEFAULT_VERSION_CODE = '26367';
5555
public const APP_DEFAULT_LANG_PACK = 'android';
5656
// https://schema.horner.tj
57-
public const APP_DEFAULT_TL_LAYER_VERSION = 135;
57+
public const APP_DEFAULT_TL_LAYER_VERSION = 140;
5858

5959
public const ENV_AUTHKEY = 'BOT'; // env variable for authkey path
6060
}

src/MTSerialization/OwnImplementation/OwnDeserializer.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,15 @@ private function readObjectField(array $objectArg, array &$bundle): void
171171
$isObjectArgOptional = $this->isObjectArgOptional($objectArg);
172172

173173
if ($isObjectArgOptional) {
174-
if (!array_key_exists('flags', $bundle)) {
174+
$flagFieldName = explode('.', $objectArg['type'])[0];
175+
if (!array_key_exists($flagFieldName, $bundle)) {
175176
throw new TGException(
176177
TGException::ERR_DESERIALIZER_FIELD_BIT_MASK_NOT_PROVIDED,
177178
print_r($bundle, true)
178179
);
179180
}
180181

181-
$objectArgValue = $this->readOptionalField($objectArg, $bundle['flags']);
182+
$objectArgValue = $this->readOptionalField($objectArg, $bundle[$flagFieldName]);
182183
} else {
183184
$objectArgValue = $this->readTypedField($objectArg['type']);
184185
}
@@ -194,7 +195,12 @@ private function readObjectField(array $objectArg, array &$bundle): void
194195
*/
195196
private function isObjectArgOptional(array $arg): bool
196197
{
197-
return strpos($arg['type'], 'flags') === 0;
198+
$flag = explode('.', $arg['type'])[0];
199+
if (strpos($arg['type'], 'flags') !== 0) {
200+
return false;
201+
}
202+
// is equals "flags" or "flagsXXX" , where XXX is number
203+
return strlen($flag) === 5 || ctype_digit(substr($flag, 5));
198204
}
199205

200206
/**

src/MTSerialization/OwnImplementation/maps/channelFullOldFormatted.json

Lines changed: 0 additions & 104 deletions
This file was deleted.

0 commit comments

Comments
 (0)