Various improvements
This commit is contained in:
parent
b0b850efe4
commit
f03705e4aa
@ -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;
|
||||
|
@ -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));
|
||||
|
@ -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']]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user