1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-30 10:59:02 +01:00
This commit is contained in:
Daniil Gentili 2021-12-07 17:16:15 +01:00
parent 0facd404ec
commit 8fd999c6fd
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
3 changed files with 8 additions and 2 deletions

View File

@ -104,6 +104,10 @@ class WriteLoop extends ResumableSignalLoop
if ($message->isEncrypted()) {
continue;
}
if ($message->getState() & OutgoingMessage::STATE_REPLIED) {
unset($connection->pendingOutgoing[$k]);
continue;
}
$skipped_all = false;
$API->logger->logger("Sending $message as unencrypted message to DC $datacenter", \danog\MadelineProto\Logger::ULTRA_VERBOSE);
$message_id = $message->getMsgId() ?? $connection->msgIdHandler->generateMessageId();

View File

@ -1245,12 +1245,14 @@ class MTProto extends AsyncConstruct implements TLCallback
}
// Connect to all DCs, start internal loops
yield from $this->connectToAllDcs();
$this->startLoops();
if (yield from $this->fullGetSelf()) {
$this->authorized = self::LOGGED_IN;
$this->setupLogger();
$this->startLoops();
yield from $this->getCdnConfig($this->datacenter->curdc);
yield from $this->initAuthorization();
} else {
$this->startLoops();
}
// onStart event handler
if ($this->event_handler && \class_exists($this->event_handler) && \is_subclass_of($this->event_handler, EventHandler::class)) {

View File

@ -178,7 +178,7 @@ class OutgoingMessage extends Message
public function sent(): void
{
if ($this->state & self::STATE_REPLIED) {
throw new Exception("Trying to resend already replied message $this!");
//throw new Exception("Trying to resend already replied message $this!");
}
$this->state |= self::STATE_SENT;
$this->sent = \time();