X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=jappixmini%2Fjappixmini.php;h=ad4d4901432c38a70dc50ac5b4fb833864654362;hb=09bb49eef5acf3b12ab6fae4687f7eec06c40eee;hp=23f99f17ad211fabf1278ce96d2d857e57fed0ec;hpb=dbe8118e406510d85404d9577f83d68782cfe2a0;p=friendica-addons.git
diff --git a/jappixmini/jappixmini.php b/jappixmini/jappixmini.php
index 23f99f17..ad4d4901 100644
--- a/jappixmini/jappixmini.php
+++ b/jappixmini/jappixmini.php
@@ -63,58 +63,59 @@
*/
use Friendica\App;
-use Friendica\Core\Addon;
-use Friendica\Core\Config;
-use Friendica\Core\L10n;
-use Friendica\Core\PConfig;
+use Friendica\Core\Hook;
+use Friendica\Core\Logger;
+use Friendica\Core\Protocol;
+use Friendica\Database\DBA;
+use Friendica\DI;
use Friendica\Model\User;
use Friendica\Util\Network;
function jappixmini_install()
{
- Addon::registerHook('addon_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings');
- Addon::registerHook('addon_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post');
+ Hook::register('addon_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings');
+ Hook::register('addon_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post');
- Addon::registerHook('page_end', 'addon/jappixmini/jappixmini.php', 'jappixmini_script');
- Addon::registerHook('authenticate', 'addon/jappixmini/jappixmini.php', 'jappixmini_login');
+ Hook::register('page_end', 'addon/jappixmini/jappixmini.php', 'jappixmini_script');
+ Hook::register('authenticate', 'addon/jappixmini/jappixmini.php', 'jappixmini_login');
- Addon::registerHook('cron', 'addon/jappixmini/jappixmini.php', 'jappixmini_cron');
+ Hook::register('cron', 'addon/jappixmini/jappixmini.php', 'jappixmini_cron');
// Jappix source download as required by AGPL
- Addon::registerHook('about_hook', 'addon/jappixmini/jappixmini.php', 'jappixmini_download_source');
+ Hook::register('about_hook', 'addon/jappixmini/jappixmini.php', 'jappixmini_download_source');
// set standard configuration
- $info_text = Config::get("jappixmini", "infotext");
+ $info_text = DI::config()->get("jappixmini", "infotext");
if (!$info_text)
- set_confConfig::setig("jappixmini", "infotext", "To get the chat working, you need to know a BOSH host which works with your Jabber account. " .
+ DI::config()->set("jappixmini", "infotext", "To get the chat working, you need to know a BOSH host which works with your Jabber account. " .
"An example of a BOSH server that works for all accounts is https://bind.jappix.com/, but keep " .
"in mind that the BOSH server can read along all chat messages. If you know that your Jabber " .
"server also provides an own BOSH server, it is much better to use this one!"
);
- $bosh_proxy = Config::get("jappixmini", "bosh_proxy");
+ $bosh_proxy = DI::config()->get("jappixmini", "bosh_proxy");
if ($bosh_proxy === "") {
- Config::set("jappixmini", "bosh_proxy", "1");
+ DI::config()->set("jappixmini", "bosh_proxy", "1");
}
// set addon version so that safe updates are possible later
- $addon_version = Config::get("jappixmini", "version");
+ $addon_version = DI::config()->get("jappixmini", "version");
if ($addon_version === "") {
- Config::set("jappixmini", "version", "1");
+ DI::config()->set("jappixmini", "version", "1");
}
}
function jappixmini_uninstall()
{
- Addon::unregisterHook('addon_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings');
- Addon::unregisterHook('addon_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post');
+ Hook::unregister('addon_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings');
+ Hook::unregister('addon_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post');
- Addon::unregisterHook('page_end', 'addon/jappixmini/jappixmini.php', 'jappixmini_script');
- Addon::unregisterHook('authenticate', 'addon/jappixmini/jappixmini.php', 'jappixmini_login');
+ Hook::unregister('page_end', 'addon/jappixmini/jappixmini.php', 'jappixmini_script');
+ Hook::unregister('authenticate', 'addon/jappixmini/jappixmini.php', 'jappixmini_login');
- Addon::unregisterHook('cron', 'addon/jappixmini/jappixmini.php', 'jappixmini_cron');
+ Hook::unregister('cron', 'addon/jappixmini/jappixmini.php', 'jappixmini_cron');
- Addon::unregisterHook('about_hook', 'addon/jappixmini/jappixmini.php', 'jappixmini_download_source');
+ Hook::unregister('about_hook', 'addon/jappixmini/jappixmini.php', 'jappixmini_download_source');
}
function jappixmini_addon_admin(App $a, &$o)
@@ -125,35 +126,35 @@ function jappixmini_addon_admin(App $a, &$o)
}
// warn if cron job has not yet been executed
- $cron_run = Config::get("jappixmini", "last_cron_execution");
+ $cron_run = DI::config()->get("jappixmini", "last_cron_execution");
if (!$cron_run) {
$o .= "
Warning: The cron job has not yet been executed. If this message is still there after some time (usually 10 minutes), this means that autosubscribe and autoaccept will not work.