App->contact is now removed

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

View file

@ -261,16 +261,11 @@ function display_content(App $a, $update = false, $update_uid = 0)
$page_uid = $item['uid'];
}
$page_contact = DBA::selectFirst('contact', ['id', 'url', 'network', 'name'], ['self' => true, 'uid' => $page_uid]);
if (DBA::isResult($page_contact)) {
// "$a->page_contact" is only used in "checkWallToWall" in Post.php.
// It is used for the wall post feature that has its issues.
// It can't work with AP or Diaspora since the creator can't sign the post with their private key.
$a->page_contact = $page_contact;
if (!empty($page_uid) && ($page_uid != local_user())) {
$page_user = User::getById($page_uid);
}
$is_owner = (local_user() && (in_array($page_uid, [local_user(), 0])) ? true : false);
$is_owner = local_user() && (in_array($page_uid, [local_user(), 0]));
if (!empty($page_user['hidewall']) && !$is_owner && !$is_remote_contact) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Access to this profile has been restricted.'));

View file

@ -64,11 +64,11 @@ function notes_content(App $a, $update = false)
'acl_data' => '',
];
$o .= status_editor($a, $x, $a->contact['id']);
$o .= status_editor($a, $x, $a->contact_id);
}
$condition = ['uid' => local_user(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => GRAVITY_PARENT,
'contact-id'=> $a->contact['id']];
'contact-id'=> $a->contact_id];
if (DI::mode()->isMobile()) {
$itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network',

View file

@ -890,7 +890,8 @@ function photos_content(App $a)
if (!$remote_contact && local_user()) {
$contact_id = $_SESSION['cid'];
$contact = $a->contact;
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => $owner_uid, 'blocked' => false, 'pending' => false]);
}
if ($user['hidewall'] && (local_user() != $owner_uid) && !$remote_contact) {

View file

@ -58,7 +58,7 @@ function redir_init(App $a) {
$contact_url = $contact['url'];
if (!empty($a->contact['id']) && $a->contact['id'] == $cid) {
if (!empty($a->contact_id) && $a->contact_id == $cid) {
// Local user is already authenticated.
redir_check_url($contact_url, $url);
$a->redirect($url ?: $contact_url);
@ -73,7 +73,7 @@ function redir_init(App $a) {
$cid = $contact['id'];
}
if (!empty($a->contact['id']) && $a->contact['id'] == $cid) {
if (!empty($a->contact_id) && $a->contact_id == $cid) {
// Local user is already authenticated.
redir_check_url($contact_url, $url);
$target_url = $url ?: $contact_url;