X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=jappixmini%2Fjappixmini.php;h=0333d8ecf79dee33e0f0a7960cb51e35c13d8820;hb=bfcf9feca18a51524fa79e7415f56a430643e9f0;hp=8111f9fd8724236737c531f0406e7399ffce8e47;hpb=1454abfdb48b8ba452d897d90f6979bb4f23912c;p=friendica-addons.git
diff --git a/jappixmini/jappixmini.php b/jappixmini/jappixmini.php
index 8111f9fd..0333d8ec 100644
--- a/jappixmini/jappixmini.php
+++ b/jappixmini/jappixmini.php
@@ -63,62 +63,47 @@
*/
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)
- Config::set("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');
-
- Addon::unregisterHook('page_end', 'addon/jappixmini/jappixmini.php', 'jappixmini_script');
- Addon::unregisterHook('authenticate', 'addon/jappixmini/jappixmini.php', 'jappixmini_login');
-
- Addon::unregisterHook('cron', 'addon/jappixmini/jappixmini.php', 'jappixmini_cron');
-
- Addon::unregisterHook('about_hook', 'addon/jappixmini/jappixmini.php', 'jappixmini_download_source');
-}
-
function jappixmini_addon_admin(App $a, &$o)
{
// display instructions and warnings on addon settings page for admin
@@ -127,35 +112,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.