mirror of
https://github.com/danog/MadelineProto.git
synced 2025-01-22 06:11:18 +01:00
Applied fixes from StyleCI
This commit is contained in:
parent
8366d2c3b6
commit
0489abba48
@ -110,5 +110,4 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB
|
||||
{
|
||||
unset($this->sock);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -44,5 +44,4 @@ class AckHandler extends \danog\MadelineProto\Tools
|
||||
array_shift($this->ack_incoming_message_ids);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -64,5 +64,4 @@ class CallHandler extends AuthKeyHandler
|
||||
}
|
||||
throw new Exception('An error occurred while calling object '.$object.'.');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -13,11 +13,10 @@ If not, see <http://www.gnu.org/licenses/>.
|
||||
namespace danog\MadelineProto\MTProtoTools;
|
||||
|
||||
/**
|
||||
* Manages packing and unpacking of messages
|
||||
* Manages packing and unpacking of messages.
|
||||
*/
|
||||
class MessageHandler extends Crypt
|
||||
{
|
||||
|
||||
/**
|
||||
* Forming the message frame and sending message to server
|
||||
* :param message: byte string to send.
|
||||
@ -108,5 +107,4 @@ class MessageHandler extends Crypt
|
||||
|
||||
return $message_data;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -17,7 +17,6 @@ namespace danog\MadelineProto\MTProtoTools;
|
||||
*/
|
||||
class MsgIdHandler extends MessageHandler
|
||||
{
|
||||
|
||||
public function check_message_id($new_message_id, $outgoing)
|
||||
{
|
||||
if (((int) ((time() + $this->timedelta - 300) * pow(2, 30)) * 4) > $new_message_id) {
|
||||
@ -49,5 +48,4 @@ class MsgIdHandler extends MessageHandler
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -103,5 +103,4 @@ class ResponseHandler extends MsgIdHandler
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -17,7 +17,6 @@ namespace danog\MadelineProto\MTProtoTools;
|
||||
*/
|
||||
class SeqNoHandler extends ResponseHandler
|
||||
{
|
||||
|
||||
public function generate_seq_no($content_related = true)
|
||||
{
|
||||
$in = $content_related ? 1 : 0;
|
||||
@ -26,5 +25,4 @@ class SeqNoHandler extends ResponseHandler
|
||||
|
||||
return ($value * 2) + $in;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -263,8 +263,10 @@ class TL
|
||||
'msg_resend_ans_req',
|
||||
]);
|
||||
}
|
||||
public function get_opts($method) {
|
||||
$opts = ["requires_answer" => !in_array($method, [
|
||||
|
||||
public function get_opts($method)
|
||||
{
|
||||
$opts = ['requires_answer' => !in_array($method, [
|
||||
'msgs_ack',
|
||||
])];
|
||||
}
|
||||
|
@ -8,8 +8,8 @@ if (!$config) {
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
function base64url_decode($data) {
|
||||
return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT));
|
||||
function base64url_decode($data)
|
||||
{
|
||||
return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT));
|
||||
}
|
||||
$MadelineProto = new \danog\MadelineProto\API($config);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user