|
@@ 310-327 (lines=18) @@
|
| 307 |
|
* |
| 308 |
|
* @throws RemoteUidException |
| 309 |
|
*/ |
| 310 |
|
private function saveRemote(RemoteInstance $remoteSignatory) { |
| 311 |
|
$this->output->writeln(''); |
| 312 |
|
$helper = $this->getHelper('question'); |
| 313 |
|
|
| 314 |
|
$this->output->writeln( |
| 315 |
|
'The remote instance <info>' . $remoteSignatory->getInstance() . '</info> looks good.' |
| 316 |
|
); |
| 317 |
|
$question = new ConfirmationQuestion( |
| 318 |
|
'Would you like to allow the sharing of your circles with this remote instance ? (y/N) ', |
| 319 |
|
false, |
| 320 |
|
'/^(y|Y)/i' |
| 321 |
|
); |
| 322 |
|
|
| 323 |
|
if ($helper->ask($this->input, $this->output, $question)) { |
| 324 |
|
$this->remoteRequest->save($remoteSignatory); |
| 325 |
|
$this->output->writeln('<info>remote instance saved</info>'); |
| 326 |
|
} |
| 327 |
|
} |
| 328 |
|
|
| 329 |
|
|
| 330 |
|
/** |
|
@@ 335-356 (lines=22) @@
|
| 332 |
|
* |
| 333 |
|
* @throws RemoteUidException |
| 334 |
|
*/ |
| 335 |
|
private function updateRemote(RemoteInstance $remoteSignatory): void { |
| 336 |
|
$this->output->writeln(''); |
| 337 |
|
$helper = $this->getHelper('question'); |
| 338 |
|
|
| 339 |
|
$this->output->writeln( |
| 340 |
|
'The remote instance <info>' . $remoteSignatory->getInstance() |
| 341 |
|
. '</info> is known but <error>its identity has changed.</error>' |
| 342 |
|
); |
| 343 |
|
$this->output->writeln( |
| 344 |
|
'<comment>If you are not sure on why identity changed, please say No to the next question and contact the admin of the remote instance</comment>' |
| 345 |
|
); |
| 346 |
|
$question = new ConfirmationQuestion( |
| 347 |
|
'Do you consider this new identity as valid and update the entry in the database? (y/N) ', |
| 348 |
|
false, |
| 349 |
|
'/^(y|Y)/i' |
| 350 |
|
); |
| 351 |
|
|
| 352 |
|
if ($helper->ask($this->input, $this->output, $question)) { |
| 353 |
|
$this->remoteStreamService->update($remoteSignatory); |
| 354 |
|
$this->output->writeln('remote instance updated'); |
| 355 |
|
} |
| 356 |
|
} |
| 357 |
|
|
| 358 |
|
|
| 359 |
|
/** |