pwr requests (#108)

* on/off switcher for pwrtelegram peer info requests

* Fix PWRTelgram requets if we have no info about peer
This commit is contained in:
Alex Morbo 2017-05-07 16:00:52 +03:00 committed by Daniil Gentili
parent a3c4f69e5d
commit b23e8d3664
2 changed files with 7 additions and 2 deletions

View File

@ -357,7 +357,12 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB
'allow_threading' => false, // Should I use threading, if it is enabled?
'handler_workers' => 10, // How many workers should every message handler pool of each socket reader have
],
'pwr' => ['pwr' => false, 'db_token' => false, 'strict' => false, 'requests' => true],
'pwr' => [
'pwr' => false, // Need info ?
'db_token' => false, // Need info ?
'strict' => false, // Need info ?
'requests' => true, // Should I get info about unknown peers from PWRTelegram?
],
];
$settings = $this->array_replace_recursive($default_settings, $settings);
if (!isset($settings['app_info']['api_id'])) {

View File

@ -211,7 +211,7 @@ trait PeerHandler
return $this->gen_all($this->chats[$id]);
}
}
if (!isset($this->settings['pwr']['request']) || $this->settings['pwr']['requests'] === true) {
if (!isset($this->settings['pwr']['requests']) || $this->settings['pwr']['requests'] === true) {
$dbres = json_decode(file_get_contents('https://id.pwrtelegram.xyz/db/getusername?id='.$id, false, stream_context_create(['http'=> [
'timeout' => 2,
],