X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=xmpp%2Fxmpp.php;h=33da9715554de63a0c0b039aa831c01411dafc88;hb=b11e418f3570a5a61bab3fb3bc2660b92635b108;hp=378a4bdc07e73521d452ff5f019382ebaf0eb6e5;hpb=48fecb9a40d0a1bac959f239be1d937edd5b7f09;p=friendica-addons.git diff --git a/xmpp/xmpp.php b/xmpp/xmpp.php index 378a4bdc..33da9715 100644 --- a/xmpp/xmpp.php +++ b/xmpp/xmpp.php @@ -8,9 +8,7 @@ */ use Friendica\App; -use Friendica\Core\Config; use Friendica\Core\Hook; -use Friendica\Core\L10n; use Friendica\Core\Renderer; use Friendica\DI; use Friendica\Util\Strings; @@ -78,13 +76,13 @@ function xmpp_addon_settings(App $a, &$s) $s .= ''; $s .= '
'; - if (Config::get("xmpp", "central_userbase")) { + if (DI::config()->get("xmpp", "central_userbase")) { $s .= ''; $s .= ''; $s .= '
'; } - if (!Config::get("xmpp", "central_userbase") || DI::pConfig()->get(local_user(), "xmpp", "individual")) { + if (!DI::config()->get("xmpp", "central_userbase") || DI::pConfig()->get(local_user(), "xmpp", "individual")) { $s .= ''; $s .= ' '; $s .= '
'; @@ -111,8 +109,8 @@ function xmpp_addon_admin(App $a, &$o) $o = Renderer::replaceMacros($t, [ '$submit' => DI::l10n()->t('Save Settings'), - '$bosh_proxy' => ['bosh_proxy', DI::l10n()->t('Jabber BOSH host'), Config::get('xmpp', 'bosh_proxy'), ''], - '$central_userbase' => ['central_userbase', DI::l10n()->t('Use central userbase'), Config::get('xmpp', 'central_userbase'), DI::l10n()->t('If enabled, users will automatically login to an ejabberd server that has to be installed on this machine with synchronized credentials via the "auth_ejabberd.php" script.')], + '$bosh_proxy' => ['bosh_proxy', DI::l10n()->t('Jabber BOSH host'), DI::config()->get('xmpp', 'bosh_proxy'), ''], + '$central_userbase' => ['central_userbase', DI::l10n()->t('Use central userbase'), DI::config()->get('xmpp', 'central_userbase'), DI::l10n()->t('If enabled, users will automatically login to an ejabberd server that has to be installed on this machine with synchronized credentials via the "auth_ejabberd.php" script.')], ]); } @@ -121,8 +119,8 @@ function xmpp_addon_admin_post() $bosh_proxy = (!empty($_POST['bosh_proxy']) ? trim($_POST['bosh_proxy']) : ''); $central_userbase = (!empty($_POST['central_userbase']) ? intval($_POST['central_userbase']) : false); - Config::set('xmpp', 'bosh_proxy', $bosh_proxy); - Config::set('xmpp', 'central_userbase', $central_userbase); + DI::config()->set('xmpp', 'bosh_proxy', $bosh_proxy); + DI::config()->set('xmpp', 'central_userbase', $central_userbase); info(DI::l10n()->t('Settings updated.') . EOL); } @@ -157,8 +155,8 @@ function xmpp_converse(App $a) DI::page()['htmlhead'] .= '' . "\n"; DI::page()['htmlhead'] .= '' . "\n"; - if (Config::get("xmpp", "central_userbase") && !DI::pConfig()->get(local_user(), "xmpp", "individual")) { - $bosh_proxy = Config::get("xmpp", "bosh_proxy"); + if (DI::config()->get("xmpp", "central_userbase") && !DI::pConfig()->get(local_user(), "xmpp", "individual")) { + $bosh_proxy = DI::config()->get("xmpp", "bosh_proxy"); $password = DI::pConfig()->get(local_user(), "xmpp", "password", '', true);