X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=jappixmini%2Fjappixmini.php;h=ad4d4901432c38a70dc50ac5b4fb833864654362;hb=09bb49eef5acf3b12ab6fae4687f7eec06c40eee;hp=84c8906450f3e3c3bd5dbd2a8a37f3d61de85031;hpb=1eb23e3667ac780ea59bad219fb1e3a0517421d9;p=friendica-addons.git
diff --git a/jappixmini/jappixmini.php b/jappixmini/jappixmini.php
index 84c89064..ad4d4901 100644
--- a/jappixmini/jappixmini.php
+++ b/jappixmini/jappixmini.php
@@ -63,9 +63,7 @@
*/
use Friendica\App;
-use Friendica\Core\Config;
use Friendica\Core\Hook;
-use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Database\DBA;
@@ -87,23 +85,23 @@ function jappixmini_install()
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");
}
}
@@ -128,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.
';
@@ -512,7 +510,7 @@ function jappixmini_script(App $a)
$autosubscribe = intval($autosubscribe);
// set proxy if necessary
- $use_proxy = Config::get('jappixmini', 'bosh_proxy');
+ $use_proxy = DI::config()->get('jappixmini', 'bosh_proxy');
if ($use_proxy) {
$proxy = DI::baseUrl()->get() . '/addon/jappixmini/proxy.php';
} else {
@@ -549,7 +547,7 @@ function jappixmini_script(App $a)
// get nickname
$r = q("SELECT `username` FROM `user` WHERE `uid`=$uid");
$nickname = json_encode($r[0]["username"]);
- $groupchats = Config::get('jappixmini', 'groupchats');
+ $groupchats = DI::config()->get('jappixmini', 'groupchats');
//if $groupchats has no value jappix_addon_start will produce a syntax error
if (empty($groupchats)) {
$groupchats = "{}";
@@ -581,7 +579,7 @@ function jappixmini_login(App $a, &$o)
function jappixmini_cron(App $a, $d)
{
// For autosubscribe/autoapprove, we need to maintain a list of jabber addresses of our contacts.
- Config::set("jappixmini", "last_cron_execution", $d);
+ DI::config()->set("jappixmini", "last_cron_execution", $d);
// go through list of users with jabber enabled
$users = q("SELECT `uid` FROM `pconfig` WHERE `cat`='jappixmini' AND (`k`='autosubscribe' OR `k`='autoapprove') AND `v`='1'");