public function sendRetry($to, $id, $t, $participant = null) { $retryNode = new ProtocolNode("retry", array("v" => "1", "count" => $this->retryCounter, "id" => $id, "t" => $t), null, null); $registrationNode = new ProtocolNode("registration", null, null, adjustId($this->axolotlStore->getLocalRegistrationId())); if ($participant != null) { //isgroups //group retry $node = new ProtocolNode("receipt", array("id" => $id, "to" => $to, "participant" => $participant, "type" => "retry", "t" => $t), array($retryNode, $registrationNode), null); } else { $node = new ProtocolNode("receipt", array("id" => $id, "to" => $to, "type" => "retry", "t" => $t), array($retryNode, $registrationNode), null); $this->retryCounter++; } $this->sendNode($node); $this->waitForServer($id); }
public function sendRetry($node, $to, $id, $t, $participant = null) { if (!isset($this->retryCounters[$id])) { $this->retryCounters[$id] = 1; } else { if (!isset($this->retryNodes[$id])) { $this->retryNodes[$id] = $node; } elseif ($this->retryCounters[$id] > 2) { $this->resetEncryption(); } } $retryNode = new ProtocolNode('retry', ['v' => '1', 'count' => '1', 'id' => $id, 't' => $t], null, null); $registrationNode = new ProtocolNode('registration', null, null, adjustId($this->axolotlStore->getLocalRegistrationId())); if ($participant != null) { //isgroups //group retry $node = new ProtocolNode('receipt', ['id' => $id, 'to' => $to, 'participant' => $participant, 'type' => 'retry', 't' => $t], [$retryNode, $registrationNode], null); } else { $node = new ProtocolNode('receipt', ['id' => $id, 'to' => $to, 'type' => 'retry', 't' => $t], [$retryNode, $registrationNode], null); if (!isset($this->retryCounters[$id])) { $this->retryCounters[$id] = 0; } $this->retryCounters[$id]++; } $this->sendNode($node); $this->waitForServer($id); }