+ if (isset($this->parameters['action'])) {
+ self::checkFormSecurityTokenRedirectOnError('contact/' . $contact['id'], 'contact_action', 't');
+
+ $cmd = $this->parameters['action'];
+ if ($cmd === 'update' && $localRelationship->rel !== Contact::NOTHING) {
+ Module\Contact::updateContactFromPoll($contact['id']);
+ }
+
+ if ($cmd === 'updateprofile') {
+ self::updateContactFromProbe($contact['id']);
+ }
+
+ if ($cmd === 'block') {
+ if ($localRelationship->blocked) {
+ // @TODO Backward compatibility, replace with $localRelationship->unblock()
+ Contact\User::setBlocked($contact['id'], DI::userSession()->getLocalUserId(), false);
+
+ $message = $this->t('Contact has been unblocked');
+ } else {
+ // @TODO Backward compatibility, replace with $localRelationship->block()
+ Contact\User::setBlocked($contact['id'], DI::userSession()->getLocalUserId(), true);
+ $message = $this->t('Contact has been blocked');
+ }
+
+ // @TODO: add $this->localRelationship->save($localRelationship);
+ DI::sysmsg()->addInfo($message);
+ }
+
+ if ($cmd === 'ignore') {
+ if ($localRelationship->ignored) {
+ // @TODO Backward compatibility, replace with $localRelationship->unblock()
+ Contact\User::setIgnored($contact['id'], DI::userSession()->getLocalUserId(), false);
+
+ $message = $this->t('Contact has been unignored');
+ } else {
+ // @TODO Backward compatibility, replace with $localRelationship->block()
+ Contact\User::setIgnored($contact['id'], DI::userSession()->getLocalUserId(), true);
+ $message = $this->t('Contact has been ignored');
+ }
+
+ // @TODO: add $this->localRelationship->save($localRelationship);
+ DI::sysmsg()->addInfo($message);
+ }
+
+ $this->baseUrl->redirect('contact/' . $contact['id']);
+ }
+