*/
use Friendica\App;
-use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\Renderer;
use Friendica\DI;
Hook::register('logged_in', 'addon/xmpp/xmpp.php', 'xmpp_login');
}
-function xmpp_uninstall()
-{
- Hook::unregister('addon_settings', 'addon/xmpp/xmpp.php', 'xmpp_addon_settings');
- Hook::unregister('addon_settings_post', 'addon/xmpp/xmpp.php', 'xmpp_addon_settings_post');
- Hook::unregister('page_end', 'addon/xmpp/xmpp.php', 'xmpp_script');
- Hook::unregister('logged_in', 'addon/xmpp/xmpp.php', 'xmpp_login');
-}
-
function xmpp_addon_settings_post()
{
if (!local_user() || empty($_POST['xmpp-settings-submit'])) {
DI::pConfig()->set(local_user(), 'xmpp', 'enabled', $_POST['xmpp_enabled'] ?? false);
DI::pConfig()->set(local_user(), 'xmpp', 'individual', $_POST['xmpp_individual'] ?? false);
DI::pConfig()->set(local_user(), 'xmpp', 'bosh_proxy', $_POST['xmpp_bosh_proxy'] ?? '');
-
- info(DI::l10n()->t('XMPP settings updated.') . EOL);
}
function xmpp_addon_settings(App $a, &$s)
$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);
-
- info(DI::l10n()->t('Settings updated.') . EOL);
+ DI::config()->set('xmpp', 'bosh_proxy', $bosh_proxy);
+ DI::config()->set('xmpp', 'central_userbase', $central_userbase);
}
function xmpp_script(App $a)