Merge branch 'master' of github.com:danog/MadelineProto into master

This commit is contained in:
Daniil Gentili 2020-10-03 12:37:10 +02:00
commit 6076118320
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
3 changed files with 6 additions and 3 deletions

View File

@ -347,6 +347,7 @@ trait ResponseHandler
case 401: case 401:
switch ($response['error_message']) { switch ($response['error_message']) {
case 'USER_DEACTIVATED': case 'USER_DEACTIVATED':
case 'USER_DEACTIVATED_BAN':
case 'SESSION_REVOKED': case 'SESSION_REVOKED':
case 'SESSION_EXPIRED': case 'SESSION_EXPIRED':
$this->gotResponseForOutgoingMessageId($request_id); $this->gotResponseForOutgoingMessageId($request_id);
@ -356,11 +357,11 @@ trait ResponseHandler
$socket->setPermAuthKey(null); $socket->setPermAuthKey(null);
$socket->resetSession(); $socket->resetSession();
} }
if ($response['error_message'] === 'USER_DEACTIVATED') { if (in_array($response['error_message'],['USER_DEACTIVATED', 'USER_DEACTIVATED_BAN'], true)) {
$this->logger->logger('!!!!!!! WARNING !!!!!!!', \danog\MadelineProto\Logger::FATAL_ERROR); $this->logger->logger('!!!!!!! WARNING !!!!!!!', \danog\MadelineProto\Logger::FATAL_ERROR);
$this->logger->logger("Telegram's flood prevention system suspended this account.", \danog\MadelineProto\Logger::ERROR); $this->logger->logger("Telegram's flood prevention system suspended this account.", \danog\MadelineProto\Logger::ERROR);
$this->logger->logger('To continue, manual verification is required.', \danog\MadelineProto\Logger::FATAL_ERROR); $this->logger->logger('To continue, manual verification is required.', \danog\MadelineProto\Logger::FATAL_ERROR);
$phone = isset($this->authorization['user']['phone']) ? '+'.$this->authorization['user']['phone'] : 'you are currently using'; $phone = isset($this->API->authorization['user']['phone']) ? '+'.$this->API->authorization['user']['phone'] : 'you are currently using';
$this->logger->logger('Send an email to recover@telegram.org, asking to unban the phone number '.$phone.', and shortly describe what will you do with this phone number.', \danog\MadelineProto\Logger::FATAL_ERROR); $this->logger->logger('Send an email to recover@telegram.org, asking to unban the phone number '.$phone.', and shortly describe what will you do with this phone number.', \danog\MadelineProto\Logger::FATAL_ERROR);
$this->logger->logger('Then login again.', \danog\MadelineProto\Logger::FATAL_ERROR); $this->logger->logger('Then login again.', \danog\MadelineProto\Logger::FATAL_ERROR);
$this->logger->logger('If you intentionally deleted this account, ignore this message.', \danog\MadelineProto\Logger::FATAL_ERROR); $this->logger->logger('If you intentionally deleted this account, ignore this message.', \danog\MadelineProto\Logger::FATAL_ERROR);
@ -395,7 +396,7 @@ trait ResponseHandler
$this->logger->logger('!!!!!!! WARNING !!!!!!!', \danog\MadelineProto\Logger::FATAL_ERROR); $this->logger->logger('!!!!!!! WARNING !!!!!!!', \danog\MadelineProto\Logger::FATAL_ERROR);
$this->logger->logger("Telegram's flood prevention system suspended this account.", \danog\MadelineProto\Logger::ERROR); $this->logger->logger("Telegram's flood prevention system suspended this account.", \danog\MadelineProto\Logger::ERROR);
$this->logger->logger('To continue, manual verification is required.', \danog\MadelineProto\Logger::FATAL_ERROR); $this->logger->logger('To continue, manual verification is required.', \danog\MadelineProto\Logger::FATAL_ERROR);
$phone = isset($this->authorization['user']['phone']) ? '+'.$this->authorization['user']['phone'] : 'you are currently using'; $phone = isset($this->API->authorization['user']['phone']) ? '+'.$this->API->authorization['user']['phone'] : 'you are currently using';
$this->logger->logger('Send an email to recover@telegram.org, asking to unban the phone number '.$phone.', and quickly describe what will you do with this phone number.', \danog\MadelineProto\Logger::FATAL_ERROR); $this->logger->logger('Send an email to recover@telegram.org, asking to unban the phone number '.$phone.', and quickly describe what will you do with this phone number.', \danog\MadelineProto\Logger::FATAL_ERROR);
$this->logger->logger('Then login again.', \danog\MadelineProto\Logger::FATAL_ERROR); $this->logger->logger('Then login again.', \danog\MadelineProto\Logger::FATAL_ERROR);
$this->logger->logger('If you intentionally deleted this account, ignore this message.', \danog\MadelineProto\Logger::FATAL_ERROR); $this->logger->logger('If you intentionally deleted this account, ignore this message.', \danog\MadelineProto\Logger::FATAL_ERROR);

View File

@ -139,6 +139,7 @@ class Settings extends SettingsAbstract
$this->secretChats->mergeArray($settings); $this->secretChats->mergeArray($settings);
$this->serialization->mergeArray($settings); $this->serialization->mergeArray($settings);
$this->schema->mergeArray($settings); $this->schema->mergeArray($settings);
$this->ipc->mergeArray($settings);
switch ($settings['db']['type'] ?? 'memory') { switch ($settings['db']['type'] ?? 'memory') {
case 'memory': case 'memory':

View File

@ -15,6 +15,7 @@ class Ipc extends SettingsAbstract
public function mergeArray(array $settings): void public function mergeArray(array $settings): void
{ {
$this->setSlow($settings['ipc']['slow'] ?? $this->getSlow());
} }
/** /**