From 346bf125a70141f8999beb9cc73866919c232b02 Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Sat, 18 Jan 2020 16:56:45 +0100 Subject: [PATCH] Move PConfig::delete() to DI::pConfig()->delete() --- catavatar/catavatar.php | 2 +- ifttt/ifttt.php | 2 +- mailstream/mailstream.php | 8 ++++---- pumpio/pumpio.php | 2 +- statusnet/statusnet.php | 28 ++++++++++++++-------------- twitter/twitter.php | 26 +++++++++++++------------- widgets/widgets.php | 2 +- 7 files changed, 35 insertions(+), 35 deletions(-) diff --git a/catavatar/catavatar.php b/catavatar/catavatar.php index 18406490..8baf0457 100644 --- a/catavatar/catavatar.php +++ b/catavatar/catavatar.php @@ -128,7 +128,7 @@ function catavatar_addon_settings_post(App $a, &$s) } if (!empty($_POST['catavatar-emailcat'])) { - PConfig::delete(local_user(), 'catavatar', 'seed'); + DI::pConfig()->delete(local_user(), 'catavatar', 'seed'); } } diff --git a/ifttt/ifttt.php b/ifttt/ifttt.php index 2be43de2..44c58739 100644 --- a/ifttt/ifttt.php +++ b/ifttt/ifttt.php @@ -89,7 +89,7 @@ function ifttt_settings(App $a, &$s) function ifttt_settings_post() { if (!empty($_POST['ifttt-submit']) && isset($_POST['ifttt-rekey'])) { - PConfig::delete(local_user(), 'ifttt', 'key'); + DI::pConfig()->delete(local_user(), 'ifttt', 'key'); } } diff --git a/mailstream/mailstream.php b/mailstream/mailstream.php index 4aad1d22..3513d581 100644 --- a/mailstream/mailstream.php +++ b/mailstream/mailstream.php @@ -403,25 +403,25 @@ function mailstream_addon_settings_post($a,$post) { DI::pConfig()->set(local_user(), 'mailstream', 'address', $_POST['mailstream_address']); } else { - PConfig::delete(local_user(), 'mailstream', 'address'); + DI::pConfig()->delete(local_user(), 'mailstream', 'address'); } if ($_POST['mailstream_nolikes']) { DI::pConfig()->set(local_user(), 'mailstream', 'nolikes', $_POST['mailstream_enabled']); } else { - PConfig::delete(local_user(), 'mailstream', 'nolikes'); + DI::pConfig()->delete(local_user(), 'mailstream', 'nolikes'); } if ($_POST['mailstream_enabled']) { DI::pConfig()->set(local_user(), 'mailstream', 'enabled', $_POST['mailstream_enabled']); } else { - PConfig::delete(local_user(), 'mailstream', 'enabled'); + DI::pConfig()->delete(local_user(), 'mailstream', 'enabled'); } if ($_POST['mailstream_attachimg']) { DI::pConfig()->set(local_user(), 'mailstream', 'attachimg', $_POST['mailstream_attachimg']); } else { - PConfig::delete(local_user(), 'mailstream', 'attachimg'); + DI::pConfig()->delete(local_user(), 'mailstream', 'attachimg'); } } diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 70352adc..08a1696b 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -373,7 +373,7 @@ function pumpio_settings_post(App $a, array &$b) DI::pConfig()->set(local_user(), 'pumpio', 'post_by_default', $_POST['pumpio_bydefault'] ?? false); if (!empty($_POST['pumpio_mirror'])) { - PConfig::delete(local_user(), 'pumpio', 'lastdate'); + DI::pConfig()->delete(local_user(), 'pumpio', 'lastdate'); } } } diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index e19b7e3f..5eaffc3d 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -134,18 +134,18 @@ function statusnet_settings_post(App $a, $post) /* * * * if the GNU Social-disconnect checkbox is set, clear the GNU Social configuration */ - PConfig::delete(local_user(), 'statusnet', 'consumerkey'); - PConfig::delete(local_user(), 'statusnet', 'consumersecret'); - PConfig::delete(local_user(), 'statusnet', 'post'); - PConfig::delete(local_user(), 'statusnet', 'post_by_default'); - PConfig::delete(local_user(), 'statusnet', 'oauthtoken'); - PConfig::delete(local_user(), 'statusnet', 'oauthsecret'); - PConfig::delete(local_user(), 'statusnet', 'baseapi'); - PConfig::delete(local_user(), 'statusnet', 'lastid'); - PConfig::delete(local_user(), 'statusnet', 'mirror_posts'); - PConfig::delete(local_user(), 'statusnet', 'import'); - PConfig::delete(local_user(), 'statusnet', 'create_user'); - PConfig::delete(local_user(), 'statusnet', 'own_url'); + DI::pConfig()->delete(local_user(), 'statusnet', 'consumerkey'); + DI::pConfig()->delete(local_user(), 'statusnet', 'consumersecret'); + DI::pConfig()->delete(local_user(), 'statusnet', 'post'); + DI::pConfig()->delete(local_user(), 'statusnet', 'post_by_default'); + DI::pConfig()->delete(local_user(), 'statusnet', 'oauthtoken'); + DI::pConfig()->delete(local_user(), 'statusnet', 'oauthsecret'); + DI::pConfig()->delete(local_user(), 'statusnet', 'baseapi'); + DI::pConfig()->delete(local_user(), 'statusnet', 'lastid'); + DI::pConfig()->delete(local_user(), 'statusnet', 'mirror_posts'); + DI::pConfig()->delete(local_user(), 'statusnet', 'import'); + DI::pConfig()->delete(local_user(), 'statusnet', 'create_user'); + DI::pConfig()->delete(local_user(), 'statusnet', 'own_url'); } else { if (isset($_POST['statusnet-preconf-apiurl'])) { /* * * @@ -225,7 +225,7 @@ function statusnet_settings_post(App $a, $post) DI::pConfig()->set(local_user(), 'statusnet', 'create_user', intval($_POST['statusnet-create_user'])); if (!intval($_POST['statusnet-mirror'])) - PConfig::delete(local_user(), 'statusnet', 'lastid'); + DI::pConfig()->delete(local_user(), 'statusnet', 'lastid'); info(L10n::t('GNU Social settings updated.') . EOL); } @@ -1575,7 +1575,7 @@ function statusnet_fetch_own_contact(App $a, $uid) if (DBA::isResult($r)) { $contact_id = $r[0]["id"]; } else { - PConfig::delete($uid, 'statusnet', 'own_url'); + DI::pConfig()->delete($uid, 'statusnet', 'own_url'); } } return $contact_id; diff --git a/twitter/twitter.php b/twitter/twitter.php index fe66886f..25c48a95 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -227,17 +227,17 @@ function twitter_settings_post(App $a) * if the twitter-disconnect checkbox is set, clear the OAuth key/secret pair * from the user configuration */ - PConfig::delete(local_user(), 'twitter', 'consumerkey'); - PConfig::delete(local_user(), 'twitter', 'consumersecret'); - PConfig::delete(local_user(), 'twitter', 'oauthtoken'); - PConfig::delete(local_user(), 'twitter', 'oauthsecret'); - PConfig::delete(local_user(), 'twitter', 'post'); - PConfig::delete(local_user(), 'twitter', 'post_by_default'); - PConfig::delete(local_user(), 'twitter', 'lastid'); - PConfig::delete(local_user(), 'twitter', 'mirror_posts'); - PConfig::delete(local_user(), 'twitter', 'import'); - PConfig::delete(local_user(), 'twitter', 'create_user'); - PConfig::delete(local_user(), 'twitter', 'own_id'); + DI::pConfig()->delete(local_user(), 'twitter', 'consumerkey'); + DI::pConfig()->delete(local_user(), 'twitter', 'consumersecret'); + DI::pConfig()->delete(local_user(), 'twitter', 'oauthtoken'); + DI::pConfig()->delete(local_user(), 'twitter', 'oauthsecret'); + DI::pConfig()->delete(local_user(), 'twitter', 'post'); + DI::pConfig()->delete(local_user(), 'twitter', 'post_by_default'); + DI::pConfig()->delete(local_user(), 'twitter', 'lastid'); + DI::pConfig()->delete(local_user(), 'twitter', 'mirror_posts'); + DI::pConfig()->delete(local_user(), 'twitter', 'import'); + DI::pConfig()->delete(local_user(), 'twitter', 'create_user'); + DI::pConfig()->delete(local_user(), 'twitter', 'own_id'); } else { if (isset($_POST['twitter-pin'])) { // if the user supplied us with a PIN from Twitter, let the magic of OAuth happen @@ -275,7 +275,7 @@ function twitter_settings_post(App $a) DI::pConfig()->set(local_user(), 'twitter', 'create_user', intval($_POST['twitter-create_user'])); if (!intval($_POST['twitter-mirror'])) { - PConfig::delete(local_user(), 'twitter', 'lastid'); + DI::pConfig()->delete(local_user(), 'twitter', 'lastid'); } info(L10n::t('Twitter settings updated.') . EOL); @@ -1834,7 +1834,7 @@ function twitter_fetch_own_contact(App $a, $uid) if (DBA::isResult($r)) { $contact_id = $r[0]["id"]; } else { - PConfig::delete($uid, 'twitter', 'own_id'); + DI::pConfig()->delete($uid, 'twitter', 'own_id'); } } diff --git a/widgets/widgets.php b/widgets/widgets.php index 0d8d2a70..35dbfa5e 100644 --- a/widgets/widgets.php +++ b/widgets/widgets.php @@ -30,7 +30,7 @@ function widgets_settings_post(){ if(! local_user()) return; if (isset($_POST['widgets-submit'])){ - PConfig::delete(local_user(), 'widgets', 'key'); + DI::pConfig()->delete(local_user(), 'widgets', 'key'); } } -- 2.39.5