-require_once("addon/diaspora/Diaspora_Connection.php");
-
-function diaspora_install() {
- register_hook('post_local', 'addon/diaspora/diaspora.php', 'diaspora_post_local');
- register_hook('notifier_normal', 'addon/diaspora/diaspora.php', 'diaspora_send');
- register_hook('jot_networks', 'addon/diaspora/diaspora.php', 'diaspora_jot_nets');
- register_hook('connector_settings', 'addon/diaspora/diaspora.php', 'diaspora_settings');
- register_hook('connector_settings_post', 'addon/diaspora/diaspora.php', 'diaspora_settings_post');
- register_hook('queue_predeliver', 'addon/diaspora/diaspora.php', 'diaspora_queue_hook');
-}
-function diaspora_uninstall() {
- unregister_hook('post_local', 'addon/diaspora/diaspora.php', 'diaspora_post_local');
- unregister_hook('notifier_normal', 'addon/diaspora/diaspora.php', 'diaspora_send');
- unregister_hook('jot_networks', 'addon/diaspora/diaspora.php', 'diaspora_jot_nets');
- unregister_hook('connector_settings', 'addon/diaspora/diaspora.php', 'diaspora_settings');
- unregister_hook('connector_settings_post', 'addon/diaspora/diaspora.php', 'diaspora_settings_post');
- unregister_hook('queue_predeliver', 'addon/diaspora/diaspora.php', 'diaspora_queue_hook');
-}
-
-
-function diaspora_jot_nets(&$a,&$b) {
- if(! local_user())
- return;
-
- $diaspora_post = get_pconfig(local_user(),'diaspora','post');
- if(intval($diaspora_post) == 1) {
- $diaspora_defpost = get_pconfig(local_user(),'diaspora','post_by_default');
- $selected = ((intval($diaspora_defpost) == 1) ? ' checked="checked" ' : '');
- $b .= '<div class="profile-jot-net"><input type="checkbox" name="diaspora_enable"' . $selected . ' value="1" /> '
- . t('Post to Diaspora') . '</div>';
- }
+require_once 'addon/diaspora/Diaspora_Connection.php';
+
+use Friendica\App;
+use Friendica\Content\Text\BBCode;
+use Friendica\Core\Hook;
+use Friendica\Core\Logger;
+use Friendica\Core\Renderer;
+use Friendica\Core\Session;
+use Friendica\Database\DBA;
+use Friendica\Core\Worker;
+use Friendica\DI;
+use Friendica\Model\Post;
+
+function diaspora_install()
+{
+ Hook::register('hook_fork', 'addon/diaspora/diaspora.php', 'diaspora_hook_fork');
+ Hook::register('post_local', 'addon/diaspora/diaspora.php', 'diaspora_post_local');
+ Hook::register('notifier_normal', 'addon/diaspora/diaspora.php', 'diaspora_send');
+ Hook::register('jot_networks', 'addon/diaspora/diaspora.php', 'diaspora_jot_nets');
+ Hook::register('connector_settings', 'addon/diaspora/diaspora.php', 'diaspora_settings');
+ Hook::register('connector_settings_post', 'addon/diaspora/diaspora.php', 'diaspora_settings_post');