X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FDelegation.php;h=c14573c8b330c9a76e55384ac6e31d6e44938aa1;hb=c81eb78e38b599c5181e63c696035658a0f38f43;hp=579b4d6b590e3bd8a6693df233352178d3fbf9af;hpb=7cdd2d1336e768def2f9b2dc1d4026f8d9bb3804;p=friendica.git diff --git a/src/Module/Delegation.php b/src/Module/Delegation.php index 579b4d6b59..c14573c8b3 100644 --- a/src/Module/Delegation.php +++ b/src/Module/Delegation.php @@ -1,6 +1,6 @@ redirect('profile/' . DI::app()->getLoggedInUserNickname()); - // NOTREACHED + notice($this->t('You are now logged in as %s', $user['username'])); + + DI::baseUrl()->redirect('network'); } - public static function content(array $parameters = []) + protected function content(array $request = []): string { if (!local_user()) { throw new ForbiddenException(DI::l10n()->t('Permission denied.')); @@ -126,14 +127,14 @@ class Delegation extends BaseModule $identities[$key]['selected'] = ($identity['nickname'] === DI::app()->getLoggedInUserNickname()); - $condition = ["`uid` = ? AND `msg` != '' AND NOT (`type` IN (?, ?)) AND NOT `seen`", $identity['uid'], Notification\Type::INTRO, Notification\Type::MAIL]; + $condition = ["`msg` != '' AND NOT (`type` IN (?, ?)) AND NOT `seen`", Notification\Type::INTRO, Notification\Type::MAIL]; $params = ['distinct' => true, 'expression' => 'parent']; - $notifications = DBA::count('notify', $condition, $params); + $notifications = DI::notify()->countForUser($identity['uid'], $condition, $params); $params = ['distinct' => true, 'expression' => 'convid']; $notifications += DBA::count('mail', ['uid' => $identity['uid'], 'seen' => false], $params); - $notifications += DBA::count('intro', ['blocked' => false, 'ignore' => false, 'uid' => $identity['uid']]); + $notifications += DI::intro()->countActiveForUser($identity['uid']); $identities[$key]['notifications'] = $notifications; }