]> git.mxchange.org Git - friendica.git/blobdiff - mod/notifications.php
Move Cache::set() to DI::cache()->set()
[friendica.git] / mod / notifications.php
index e083e3b44cc1631a878f3988e82b72e09dfbd886..73730b50a52957e8ebaac07d7ce13c5d0753b3a0 100644 (file)
@@ -17,12 +17,11 @@ use Friendica\DI;
 use Friendica\Module\Security\Login;
 use Friendica\Model\Contact;
 use Friendica\Model\Introduction;
-use Friendica\Model\Notify;
 
 function notifications_post(App $a)
 {
        if (!local_user()) {
-               $a->internalRedirect();
+               DI::baseUrl()->redirect();
        }
 
        $request_id = (($a->argc > 1) ? $a->argv[1] : 0);
@@ -32,9 +31,7 @@ function notifications_post(App $a)
        }
 
        if ($request_id) {
-               /** @var Introduction $Intro */
-               $Intro = \Friendica\BaseObject::getClass(Introduction::class);
-               $Intro->fetch(['id' => $request_id, 'uid' => local_user()]);
+               $Intro = DI::intro()->fetch(['id' => $request_id, 'uid' => local_user()]);
 
                switch ($_POST['submit']) {
                        case L10n::t('Discard'):
@@ -45,7 +42,7 @@ function notifications_post(App $a)
                                break;
                }
 
-               $a->internalRedirect('notifications/intros');
+               DI::baseUrl()->redirect('notifications/intros');
        }
 }
 
@@ -113,11 +110,11 @@ function notifications_content(App $a)
                $notifs = $nm->getHomeList($show, $startrec, $perpage);
        // fallback - redirect to main page
        } else {
-               $a->internalRedirect('notifications');
+               DI::baseUrl()->redirect('notifications');
        }
 
        // Set the pager
-       $pager = new Pager($a->query_string, $perpage);
+       $pager = new Pager(DI::args()->getQueryString(), $perpage);
 
        // Add additional informations (needed for json output)
        $notifs['items_page'] = $pager->getItemsPerPage();