1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-27 00:34:40 +01:00

Apply fixes from StyleCI

This commit is contained in:
Daniil Gentili 2017-06-30 13:37:18 +00:00 committed by StyleCI Bot
parent 70a85cb6be
commit dddad90616
2 changed files with 31 additions and 31 deletions

View File

@ -669,15 +669,15 @@ class MTProto extends \Volatile
'layer' => $this->settings['tl_schema']['layer'],
'query' => $this->serialize_method('initConnection',
[
'api_id' => $this->settings['app_info']['api_id'],
'api_hash' => $this->settings['app_info']['api_hash'],
'device_model' => strpos($options['datacenter'], 'cdn') === false ? $this->settings['app_info']['device_model'] : 'n/a',
'system_version' => strpos($options['datacenter'], 'cdn') === false ? $this->settings['app_info']['system_version'] : 'n/a',
'app_version' => $this->settings['app_info']['app_version'],
'api_id' => $this->settings['app_info']['api_id'],
'api_hash' => $this->settings['app_info']['api_hash'],
'device_model' => strpos($options['datacenter'], 'cdn') === false ? $this->settings['app_info']['device_model'] : 'n/a',
'system_version' => strpos($options['datacenter'], 'cdn') === false ? $this->settings['app_info']['system_version'] : 'n/a',
'app_version' => $this->settings['app_info']['app_version'],
'system_lang_code' => $this->settings['app_info']['lang_code'],
'lang_code' => $this->settings['app_info']['lang_code'],
'lang_pack' => '',
'query' => $this->serialize_method($method, $arguments),
'lang_code' => $this->settings['app_info']['lang_code'],
'lang_pack' => '',
'query' => $this->serialize_method($method, $arguments),
]
),
],

View File

@ -73,8 +73,8 @@ $message = (getenv('TRAVIS_COMMIT') == '') ? 'I iz works always (io laborare sem
echo 'Serializing MadelineProto to session.madeline...'.PHP_EOL; echo 'Wrote
'.\danog\MadelineProto\Serialization::serialize('session.madeline', $MadelineProto).' bytes'.PHP_EOL;
if (stripos(readline('Do you want to make the secret chat tests? (y/n): '), 'y') !== false) {
$start = false;
var_dump($id = $MadelineProto->request_call('@danogentili', [
$start = false;
var_dump($id = $MadelineProto->request_call('@danogentili', [
'set_state' => function ($state) {
var_dump("SET STATE $state");
},
@ -106,31 +106,32 @@ var_dump($id = $MadelineProto->request_call('@danogentili', [
],
]));
while (!$start) $MadelineProto->get_updates();
$controller = $MadelineProto->get_call($id)['controller'];
$samplerate = 48000;
$period = 1 / $samplerate;
$writePeriod = $period * 960;
var_dump($writePeriod);
var_dump('SENDING DATA');
$f = fopen('output.raw', 'r');
$time = microtime(true);
while (!feof($f)) {
var_dump($t = (int) (($writePeriod -
while (!$start) {
$MadelineProto->get_updates();
}
$controller = $MadelineProto->get_call($id)['controller'];
$samplerate = 48000;
$period = 1 / $samplerate;
$writePeriod = $period * 960;
var_dump($writePeriod);
var_dump('SENDING DATA');
$f = fopen('output.raw', 'r');
$time = microtime(true);
while (!feof($f)) {
var_dump($t = (int) (($writePeriod -
(microtime(true) - $time) // Time it took me to write frames
) * 1000000));
usleep(
usleep(
$t
);
$time = microtime(true);
var_dump($controller->writeFrames(stream_get_contents($f, 960 * 2)));
var_dump('sent 960 frames');
}
$time = microtime(true);
var_dump($controller->writeFrames(stream_get_contents($f, 960 * 2)));
var_dump('sent 960 frames');
}
while ($MadelineProto->call_status($id) !== \danog\MadelineProto\MTProto::READY) {
$MadelineProto->get_updates();
}
while ($MadelineProto->call_status($id) !== \danog\MadelineProto\MTProto::READY) {
$MadelineProto->get_updates();
}
var_dump(getenv('TEST_SECRET_CHAT'));
$secret = $MadelineProto->API->request_secret_chat(getenv('TEST_SECRET_CHAT'));
@ -199,7 +200,6 @@ $mention = $MadelineProto->get_info(getenv('TEST_USERNAME')); // Returns an arra
$mention = $mention['user_id']; // Selects only the numeric user id
$media = [];
// Sticker
$inputFile = $MadelineProto->upload('tests/lel.webp');
$media['sticker'] = ['_' => 'inputMediaUploadedDocument', 'file' => $inputFile, 'mime_type' => mime_content_type('tests/lel.webp'), 'caption' => 'test', 'attributes' => [['_' => 'documentAttributeSticker', 'alt' => 'LEL', 'stickerset' => ['_' => 'inputStickerSetEmpty']]]];