App->contact is now removed

This commit is contained in:
Michael 2021-07-24 11:49:11 +00:00
parent f60d60e997
commit 30aad250df
16 changed files with 65 additions and 54 deletions

View file

@ -11,6 +11,7 @@ use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model;
use Friendica\Model\Contact;
use Friendica\Network\HTTPException;
use Friendica\Protocol\Activity;
use Friendica\Util\XML;
@ -59,7 +60,7 @@ class Poke extends BaseModule
$deny_cid = ($private ? '' : $a->user['deny_cid']);
$deny_gid = ($private ? '' : $a->user['deny_gid']);
$actor = $a->contact;
$actor = Contact::getById($a->contact_id);
$uri = Model\Item::newURI($uid);

View file

@ -118,7 +118,7 @@ class Delegation extends BaseModule
throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
}
$identities = DI::app()->identities;
$identities = User::identities(DI::session()->get('submanage') ?: local_user());
//getting additinal information for each identity
foreach ($identities as $key => $identity) {

View file

@ -28,6 +28,7 @@ use Friendica\Core\Hook;
use Friendica\Core\Renderer;
use Friendica\Core\Theme;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Item;
use Friendica\Model\User;
use Friendica\Module\Security\Login;
@ -86,7 +87,7 @@ class Compose extends BaseModule
$compose_title = DI::l10n()->t('Compose new personal note');
$type = 'note';
$doesFederate = false;
$contact_allow_list = [$a->contact['id']];
$contact_allow_list = [$a->contact_id];
$group_allow_list = [];
$contact_deny_list = [];
$group_deny_list = [];
@ -129,6 +130,8 @@ class Compose extends BaseModule
DI::page()->registerFooterScript(Theme::getPathForFile('js/linkPreview.js'));
DI::page()->registerFooterScript(Theme::getPathForFile('js/compose.js'));
$contact = Contact::getById($a->contact_id);
$tpl = Renderer::getMarkupTemplate('item/compose.tpl');
return Renderer::replaceMacros($tpl, [
'$compose_title'=> $compose_title,
@ -138,9 +141,9 @@ class Compose extends BaseModule
'$type' => $type,
'$wall' => $wall,
'$default' => '',
'$mylink' => DI::baseUrl()->remove($a->contact['url']),
'$mylink' => DI::baseUrl()->remove($contact['url']),
'$mytitle' => DI::l10n()->t('This is you'),
'$myphoto' => DI::baseUrl()->remove($a->contact['thumb']),
'$myphoto' => DI::baseUrl()->remove($contact['thumb']),
'$submit' => DI::l10n()->t('Submit'),
'$edbold' => DI::l10n()->t('Bold'),
'$editalic' => DI::l10n()->t('Italic'),

View file

@ -65,7 +65,7 @@ class Magic extends BaseModule
$contact = DBA::selectFirst('contact', ['id', 'nurl', 'url'], ['id' => $cid]);
// Redirect if the contact is already authenticated on this site.
if (!empty($a->contact) && array_key_exists('id', $a->contact) && strpos($contact['nurl'], Strings::normaliseLink(DI::baseUrl()->get())) !== false) {
if (!empty($a->contact_id) && strpos($contact['nurl'], Strings::normaliseLink(DI::baseUrl()->get())) !== false) {
if ($test) {
$ret['success'] = true;
$ret['message'] .= 'Local site - you are already authenticated.' . EOL;