Fix redirect

This commit is contained in:
Daniil Gentili 2020-07-12 00:34:09 +02:00
parent 2463fd7261
commit 84ba71475d
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -50,14 +50,16 @@ trait CallHandler
foreach ($message_ids as $message_id) {
if (isset($this->outgoing_messages[$message_id]['body'])) {
if ($datacenter) {
unset($this->outgoing_messages[$message_id]['msg_id']);
unset($this->outgoing_messages[$message_id]['seqno']);
Tools::call($this->API->datacenter->waitGetConnection($datacenter))->onResolve(function ($e, $r) use ($message_id) {
Tools::callFork($r->sendMessage($this->outgoing_messages[$message_id], false));
});
$this->ackOutgoingMessageId($message_id);
$this->gotResponseForOutgoingMessageId($message_id);
} else {
Tools::callFork($this->sendMessage($this->outgoing_messages[$message_id], false));
}
//$this->ackOutgoingMessageId($message_id);
//$this->gotResponseForOutgoingMessageId($message_id);
} else {
$this->logger->logger('Could not resend '.(isset($this->outgoing_messages[$message_id]['_']) ? $this->outgoing_messages[$message_id]['_'] : $message_id));
}