Various improvements
This commit is contained in:
parent
b0b850efe4
commit
f03705e4aa
|
@ -140,6 +140,7 @@ trait AckHandler
|
||||||
}
|
}
|
||||||
if ($message->getState() & OutgoingMessage::STATE_REPLIED) {
|
if ($message->getState() & OutgoingMessage::STATE_REPLIED) {
|
||||||
$this->logger->logger("Already replied to message $message, but still in new_outgoing");
|
$this->logger->logger("Already replied to message $message, but still in new_outgoing");
|
||||||
|
unset($this->new_outgoing[$message_id]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$result[] = $message_id;
|
$result[] = $message_id;
|
||||||
|
|
|
@ -51,23 +51,23 @@ trait CallHandler
|
||||||
: [$message_id];
|
: [$message_id];
|
||||||
foreach ($message_ids as $message_id) {
|
foreach ($message_ids as $message_id) {
|
||||||
if (isset($this->outgoing_messages[$message_id])
|
if (isset($this->outgoing_messages[$message_id])
|
||||||
&& $this->outgoing_messages[$message_id]->canGarbageCollect()) {
|
&& !$this->outgoing_messages[$message_id]->canGarbageCollect()) {
|
||||||
if ($datacenter) {
|
if ($datacenter) {
|
||||||
/** @var OutgoingMessage */
|
/** @var OutgoingMessage */
|
||||||
$message = $this->outgoing_messages[$message_id];
|
$message = $this->outgoing_messages[$message_id];
|
||||||
|
$this->gotResponseForOutgoingMessage($message);
|
||||||
$message->setMsgId(null);
|
$message->setMsgId(null);
|
||||||
$message->setSeqNo(null);
|
$message->setSeqNo(null);
|
||||||
Tools::call($this->API->datacenter->waitGetConnection($datacenter))->onResolve(function ($e, $r) use ($message) {
|
Tools::call($this->API->datacenter->waitGetConnection($datacenter))->onResolve(function ($e, $r) use ($message) {
|
||||||
Tools::callFork($r->sendMessage($message, false));
|
Tools::callFork($r->sendMessage($message, false));
|
||||||
});
|
});
|
||||||
$this->gotResponseForOutgoingMessage($message);
|
|
||||||
} else {
|
} else {
|
||||||
/** @var OutgoingMessage */
|
/** @var OutgoingMessage */
|
||||||
$message = $this->outgoing_messages[$message_id];
|
$message = $this->outgoing_messages[$message_id];
|
||||||
Tools::callFork($this->sendMessage($message, false));
|
|
||||||
if (!$message->hasSeqNo()) {
|
if (!$message->hasSeqNo()) {
|
||||||
$this->gotResponseForOutgoingMessage($message);
|
$this->gotResponseForOutgoingMessage($message);
|
||||||
}
|
}
|
||||||
|
Tools::callFork($this->sendMessage($message, false));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->logger->logger('Could not resend '.($this->outgoing_messages[$message_id] ?? $message_id));
|
$this->logger->logger('Could not resend '.($this->outgoing_messages[$message_id] ?? $message_id));
|
||||||
|
|
|
@ -387,7 +387,7 @@ trait UpdateHandler
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'encryptedChatDiscarded':
|
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']])) {
|
if (isset($this->secret_chats[$update['chat']['id']])) {
|
||||||
unset($this->secret_chats[$update['chat']['id']]);
|
unset($this->secret_chats[$update['chat']['id']]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue