Merge remote

This commit is contained in:
Daniil Gentili 2018-06-29 18:15:51 +02:00
commit c1e2c93af7
5 changed files with 18 additions and 17 deletions

View File

@ -580,7 +580,6 @@ trait AuthKeyHandler
$this->updates_state['sync_loading'] = false;
$this->handle_pending_updates();
}
}
public function sync_authorization($id)

View File

@ -133,7 +133,6 @@ trait TL
$key++;
}
} else {
foreach ($TL_dict['constructors'] as $key => $value) {
$TL_dict['constructors'][$key]['id'] = $this->pack_signed_int($TL_dict['constructors'][$key]['id']);
}
@ -315,7 +314,7 @@ trait TL
throw new Exception(\danog\MadelineProto\Lang::$current_lang['array_invalid']);
}
if (isset($object['_'])) {
throw new Exception('You must provide an array of '.$type['subtype']." objects, not a ".$type['subtype']." object. Example: [['_' => ".$type['subtype'].", ... ]]");
throw new Exception('You must provide an array of '.$type['subtype'].' objects, not a '.$type['subtype']." object. Example: [['_' => ".$type['subtype'].', ... ]]');
}
$concat = $this->constructors->find_by_predicate('vector')['id'];
$concat .= $this->pack_unsigned_int(count($object));

View File

@ -34,10 +34,12 @@ trait TOS
$this->logger->logger('By declining the TOS, the currently logged in account will be PERMANENTLY DELETED.', \danog\MadelineProto\Logger::FATAL_ERROR);
$this->logger->logger('Read the following TOS very carefully: ', \danog\MadelineProto\Logger::ERROR);
$this->logger->logger($this->tos);
throw new \danog\MadelineProto\Exception('TOS action required, check the logs', 0, null, 'MadelineProto', 1);
}
}
}
public function accept_tos()
{
$this->tos['accepted'] = $this->method_call('help.acceptTermsOfService', ['id' => $this->tos['terms_of_service']['id']], ['datacenter' => $this->datacenter->curdc]);
@ -47,6 +49,7 @@ trait TOS
throw new \danog\MadelineProto\Exception('An error occurred while accepting the TOS');
}
}
public function decline_tos()
{
$this->method_call('account.deleteAccount', ['reason' => 'Decline ToS update'], ['datacenter' => $this->datacenter->curdc]);