mirror of
https://github.com/danog/MadelineProto.git
synced 2025-01-23 10:31:13 +01:00
Cleanup
This commit is contained in:
parent
fbc20f9521
commit
48abbd5838
2
docs
2
docs
@ -1 +1 @@
|
||||
Subproject commit 9182152e87f4c2cc797840bc236041ecf2fe7573
|
||||
Subproject commit fc9602448c03c249276623c701d37834f2e3f001
|
@ -359,10 +359,10 @@ final class Connection
|
||||
} else {
|
||||
$arguments['channel'] = $content;
|
||||
}
|
||||
} elseif ($method === 'messages.sendMessage' &&
|
||||
} elseif ($method === 'messages.sendMessage' &&
|
||||
(
|
||||
(isset($arguments['peer']['_']) && \in_array($arguments['peer']['_'], ['inputEncryptedChat', 'updateEncryption', 'updateEncryptedChatTyping', 'updateEncryptedMessagesRead', 'updateNewEncryptedMessage', 'encryptedMessage', 'encryptedMessageService'], true))
|
||||
|| (is_int($arguments['peer']) && DialogId::isSecretChat($arguments['peer']))
|
||||
|| (\is_int($arguments['peer']) && DialogId::isSecretChat($arguments['peer']))
|
||||
)
|
||||
) {
|
||||
$method = 'messages.sendEncrypted';
|
||||
|
@ -45,7 +45,7 @@ trait Methods
|
||||
{
|
||||
static $bots;
|
||||
if (!$bots) {
|
||||
$bots = \json_decode(\file_get_contents('https://rpc.madelineproto.xyz/bot.json'), true)['result'];
|
||||
$bots = \json_decode(\file_get_contents('https://raw.githubusercontent.com/danog/rpc-db/master/bot.json'), true)['result'];
|
||||
}
|
||||
static $errors;
|
||||
if (!$errors) {
|
||||
|
@ -25,7 +25,6 @@ use danog\MadelineProto\Loop\InternalLoop;
|
||||
use danog\MadelineProto\MTProto;
|
||||
use danog\MadelineProto\SecretChats\SecretChatController;
|
||||
use danog\MadelineProto\SecurityException;
|
||||
use Revolt\EventLoop;
|
||||
|
||||
/**
|
||||
* Secret feed loop.
|
||||
@ -56,7 +55,7 @@ final class SecretFeedLoop extends Loop
|
||||
{
|
||||
return ['API', 'secretChat', 'incomingUpdates'];
|
||||
}
|
||||
public function __wakeup()
|
||||
public function __wakeup(): void
|
||||
{
|
||||
if (!isset($this->API->logger)) {
|
||||
$this->API->setupLogger();
|
||||
|
@ -162,7 +162,7 @@ trait CallHandler
|
||||
}
|
||||
$response = new DeferredFuture;
|
||||
// Closures only used for upload.saveFilePart
|
||||
if (is_array($args)) {
|
||||
if (\is_array($args)) {
|
||||
$this->methodAbstractions($method, $args);
|
||||
if (\in_array($method, ['messages.sendEncrypted', 'messages.sendEncryptedFile', 'messages.sendEncryptedService'], true)) {
|
||||
$args = $this->API->getSecretChatController($args['peer'])->encryptSecretMessage($args, $response->getFuture());
|
||||
|
@ -1020,7 +1020,7 @@ trait UpdateHandler
|
||||
}
|
||||
}
|
||||
if ($update['_'] === 'updateNewEncryptedMessage' && !isset($update['message']['decrypted_message'])) {
|
||||
EventLoop::queue(function () use ($update) {
|
||||
EventLoop::queue(function () use ($update): void {
|
||||
if (isset($update['qts'])) {
|
||||
$cur_state = ($this->loadUpdateState());
|
||||
if ($cur_state->qts() === -1) {
|
||||
@ -1047,7 +1047,7 @@ trait UpdateHandler
|
||||
return;
|
||||
}
|
||||
if ($update['_'] === 'updateEncryption') {
|
||||
EventLoop::queue(function () use ($update) {
|
||||
EventLoop::queue(function () use ($update): void {
|
||||
switch ($update['chat']['_']) {
|
||||
case 'encryptedChatRequested':
|
||||
if (!$this->settings->getSecretChats()->canAccept($update['chat']['admin_id'])) {
|
||||
|
@ -28,7 +28,6 @@ use danog\MadelineProto\Logger;
|
||||
use danog\MadelineProto\Loop\Secret\SecretFeedLoop;
|
||||
use danog\MadelineProto\Loop\Update\UpdateLoop;
|
||||
use danog\MadelineProto\MTProto;
|
||||
use danog\MadelineProto\MTProto\MTProtoOutgoingMessage;
|
||||
use danog\MadelineProto\MTProtoTools\Crypt;
|
||||
use danog\MadelineProto\MTProtoTools\DialogId;
|
||||
use danog\MadelineProto\ResponseException;
|
||||
|
Loading…
x
Reference in New Issue
Block a user