Various improvements

This commit is contained in:
Daniil Gentili 2020-10-18 16:02:08 +02:00
parent b0b850efe4
commit f03705e4aa
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
3 changed files with 5 additions and 4 deletions

View File

@ -140,6 +140,7 @@ trait AckHandler
}
if ($message->getState() & OutgoingMessage::STATE_REPLIED) {
$this->logger->logger("Already replied to message $message, but still in new_outgoing");
unset($this->new_outgoing[$message_id]);
continue;
}
$result[] = $message_id;

View File

@ -51,23 +51,23 @@ trait CallHandler
: [$message_id];
foreach ($message_ids as $message_id) {
if (isset($this->outgoing_messages[$message_id])
&& $this->outgoing_messages[$message_id]->canGarbageCollect()) {
&& !$this->outgoing_messages[$message_id]->canGarbageCollect()) {
if ($datacenter) {
/** @var OutgoingMessage */
$message = $this->outgoing_messages[$message_id];
$this->gotResponseForOutgoingMessage($message);
$message->setMsgId(null);
$message->setSeqNo(null);
Tools::call($this->API->datacenter->waitGetConnection($datacenter))->onResolve(function ($e, $r) use ($message) {
Tools::callFork($r->sendMessage($message, false));
});
$this->gotResponseForOutgoingMessage($message);
} else {
/** @var OutgoingMessage */
$message = $this->outgoing_messages[$message_id];
Tools::callFork($this->sendMessage($message, false));
if (!$message->hasSeqNo()) {
$this->gotResponseForOutgoingMessage($message);
}
Tools::callFork($this->sendMessage($message, false));
}
} else {
$this->logger->logger('Could not resend '.($this->outgoing_messages[$message_id] ?? $message_id));

View File

@ -387,7 +387,7 @@ trait UpdateHandler
}
break;
case 'encryptedChatDiscarded':
$this->logger->logger('Deleting secret chat '.$update['chat']['id'].' because it was revoked by the other user', \danog\MadelineProto\Logger::NOTICE);
$this->logger->logger('Deleting secret chat '.$update['chat']['id'].' because it was revoked by the other user (it was probably accepted by another client)', \danog\MadelineProto\Logger::NOTICE);
if (isset($this->secret_chats[$update['chat']['id']])) {
unset($this->secret_chats[$update['chat']['id']]);
}