- **uid** (input): the user id to revoke the block for.
- **result** (output): a boolean value indicating wether the operation was successful or not.
+### support_probe
+
+Called to assert whether a connector addon provides probing capabilities.
+
+Hook data:
+- **protocol** (input): shorthand for the protocol. List of values is available in `src/Core/Protocol.php`.
+- **result** (output): should be true if the connector provides follow capabilities, left alone otherwise.
+
### storage_instance
Called when a custom storage is used (e.g. webdav_storage)
Hook::callAll('revoke_follow', $hook_data);
Hook::callAll('block', $hook_data);
Hook::callAll('unblock', $hook_data);
+ Hook::callAll('support_probe', $hook_data);
### src/Core/Logger/Factory.php
Hook::callAll('revoke_follow', $hook_data);
Hook::callAll('block', $hook_data);
Hook::callAll('unblock', $hook_data);
+ Hook::callAll('support_probe', $hook_data);
### src/Core/Logger/Factory.php
return $hook_data['result'];
}
+
+ /**
+ * Returns whether the provided protocol supports probing for contacts
+ *
+ * @param $protocol
+ * @return bool
+ * @throws HTTPException\InternalServerErrorException
+ */
+ public static function supportsProbe($protocol): bool
+ {
+ if (in_array($protocol, self::NATIVE_SUPPORT)) {
+ return true;
+ }
+
+ $hook_data = [
+ 'protocol' => $protocol,
+ 'result' => null
+ ];
+ Hook::callAll('support_probe', $hook_data);
+
+ return $hook_data['result'] === true;
+ }
}
];
}
- if (in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
+ if (Protocol::supportsProbe($contact['network'])) {
$contact_actions['updateprofile'] = [
'label' => $this->t('Refetch contact data'),
'url' => 'contact/' . $contact['id'] . '/updateprofile?t=' . $formSecurityToken,