This commit is contained in:
Daniil Gentili 2017-01-15 02:10:44 +01:00
parent cec3294a3a
commit 5e5deca720
2 changed files with 19 additions and 6 deletions

View File

@ -234,6 +234,7 @@ trait PeerHandler
$res['type'] = $constructor['bot'] ? 'bot' : 'user';
break;
case 'chat':
case 'chatForbidden':
$res['InputPeer'] = ['_' => 'inputPeerChat', 'chat_id' => $constructor['id']];
$res['Peer'] = ['_' => 'peerChat', 'chat_id' => $constructor['id']];
$res['chat_id'] = $constructor['id'];

View File

@ -34,14 +34,26 @@ trait UpdateHandler
public function pwr_update_handler($update)
{
if (isset($update['message']['to_id']) && time() - $this->full_chat_last_updated($update['message']['to_id']) <= 600) {
$full_chat = $this->get_pwr_chat($update['message']['to_id']);
$full_chat['last_update'] = time();
$this->full_chats[$full_chat['id']] = $full_chat;
try {
$full_chat = $this->get_pwr_chat($update['message']['to_id']);
$full_chat['last_update'] = time();
$this->full_chats[$full_chat['id']] = $full_chat;
} catch (\danog\MadelineProto\Exception $e) {
\danog\MadelineProto\Logger::log($e->getMessage());
} catch (\danog\MadelineProto\RPCErrorException $e) {
\danog\MadelineProto\Logger::log($e->getMessage());
}
}
if (isset($update['message']['from_id']) && time() - $this->full_chat_last_updated($update['message']['from_id']) <= 600) {
$full_chat = $this->get_pwr_chat($update['message']['from_id']);
$full_chat['last_update'] = time();
$this->full_chats[$full_chat['id']] = $full_chat;
try {
$full_chat = $this->get_pwr_chat($update['message']['from_id']);
$full_chat['last_update'] = time();
$this->full_chats[$full_chat['id']] = $full_chat;
} catch (\danog\MadelineProto\Exception $e) {
\danog\MadelineProto\Logger::log($e->getMessage());
} catch (\danog\MadelineProto\RPCErrorException $e) {
\danog\MadelineProto\Logger::log($e->getMessage());
}
}
}