This commit is contained in:
Daniil Gentili 2018-07-13 00:45:14 +00:00
parent 5d3d899b34
commit 384039eea7
4 changed files with 8 additions and 5 deletions

2
docs

@ -1 +1 @@
Subproject commit 1c204d1dbdaea25559ac9a89d51c8850e005b772
Subproject commit 4462f6f0c4391a3a1c6ce4f2b5cb02081a635a88

View File

@ -280,7 +280,7 @@ Propic art by @magnaluna on [deviantart](https://magnaluna.deviantart.com).", 'p
}
}
}
$MadelineProto = new \danog\MadelineProto\API('session.madeline', ['secret_chats' => ['accept_chats' => false]]);
$MadelineProto = new \danog\MadelineProto\API('session.madeline', ['secret_chats' => ['accept_chats' => false], 'logger' => ['logger' => 2, 'logger_param' => getcwd().'/MadelineProto.log']]);
$MadelineProto->start();
if (!isset($MadelineProto->programmed_call)) {

View File

@ -64,6 +64,11 @@ class Logger
$this->prefix = $prefix === '' ? '' : ', '.$prefix;
$this->level = $level;
if ($this->mode === 2 && !file_exists(pathinfo($this->optional, PATHINFO_DIRNAME))) {
$this->optional = Absolute::absolute(getcwd().'/MadelineProto.log');
}
if ($mode === 2 && $max_size !== -1 && file_exists($this->optional) && filesize($this->optional) > $max_size) {
unlink($this->optional);
}

View File

@ -214,9 +214,7 @@ class MTProto
}
if (isset($this->settings['tl_schema']['src']['botAPI']) && $this->settings['tl_schema']['src']['botAPI'] !== __DIR__.'/TL_botAPI.tl') {
$settings = $this->settings;
unset($settings['tl_schema']);
$this->__construct($settings);
unset($this->v);
}
if (!isset($this->v) || $this->v !== self::V) {
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['serialization_ofd'], Logger::WARNING);