aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-04-04 16:00:58 -0700
committerFriendika <info@friendika.com>2011-04-04 16:00:58 -0700
commit178362e50b846aef1caf4e191ea0394c5d636857 (patch)
tree2511adec9a89a4eef60e5435548f0ca50d99081c
parent1bba63fb607c2cb5fb2c002e63ad7128ecf8b1ea (diff)
downloadvolse-hubzilla-178362e50b846aef1caf4e191ea0394c5d636857.tar.gz
volse-hubzilla-178362e50b846aef1caf4e191ea0394c5d636857.tar.bz2
volse-hubzilla-178362e50b846aef1caf4e191ea0394c5d636857.zip
cleaned up photo_menu check and explanation
-rw-r--r--boot.php30
1 files changed, 14 insertions, 16 deletions
diff --git a/boot.php b/boot.php
index 34be06c81..3b86d0dbe 100644
--- a/boot.php
+++ b/boot.php
@@ -2687,37 +2687,35 @@ function item_photo_menu($item){
$profile_link = ((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
- $contact_uid = ((x($item,'contact-uid')) && intval($item['contact-uid']) ? intval($item['contact-uid']) : 0);
+ // $item['contact-uid'] is only set on profile page and indicates the uid of the user who owns the profile.
- // $item['contact-uid'] is only set on profile page.
- // So we are checking for a profile page where the viewer owns the page,
- // otherwise a logged in user if some other page that displays items.
+ $profile_owner = ((x($item,'contact-uid')) && intval($item['contact-uid']) ? intval($item['contact-uid']) : 0);
+
+ // So we are checking that this is a logged in user on some page that *isn't* a profile page
+ // OR a profile page where the viewer owns the profile.
// Then check if we can use a sparkle (redirect) link to the profile by virtue of it being our contact
// or a friend's contact that we both have a connection to.
- if(((local_user() && (! $contact_uid)) || ($contact_uid && $contact_uid == local_user())) && strlen($item['author-link'])) {
+ if(((local_user() && ($profile_owner == 0))
+ || ($profile_owner && $profile_owner == local_user()))
+ && strlen($item['author-link'])) {
+
if(link_compare($item['author-link'],$item['url']) && ($item['network'] === 'dfrn') && (! $item['self'])) {
$status_link = $redirect_url."?url=status";
$profile_link = $redirect_url."?url=profile";
$photos_link = $redirect_url."?url=photos";
- if (local_user() && (! link_compare($_SESSION['my_url'],$item['author-link']))) {
- $pm_url = $a->get_baseurl() . '/message/new/' . $item['cid'];
- $contact_url = $item['self']?"":$a->get_baseurl() . '/contacts/' . $item['cid'];
- }
+ $pm_url = $a->get_baseurl() . '/message/new/' . $item['cid'];
+ $contact_url = $item['self']?"":$a->get_baseurl() . '/contacts/' . $item['cid'];
}
elseif(isset($a->authors[$item['author-link']])) {
$redirect_url = $a->get_baseurl() . '/redir/' . $a->authors[$item['author-link']]['id'];
$status_link = $redirect_url."?url=status";
$profile_link = $redirect_url."?url=profile";
$photos_link = $redirect_url."?url=photos";
-
- if (local_user() && (! link_compare($_SESSION['my_url'],$a->authors[$item['author-link']]['url']))) {
- if ($a->authors[$item['author-link']]['network']==='dfrn'){
- $pm_url = $a->get_baseurl() . '/message/new/' . $a->authors[$item['author-link']]['id'];
- }
- $contact_url = $item['self']?"":$a->get_baseurl() . '/contacts/' . $a->authors[$item['author-link']]['id'] ;
+ if ($a->authors[$item['author-link']]['network']==='dfrn'){
+ $pm_url = $a->get_baseurl() . '/message/new/' . $a->authors[$item['author-link']]['id'];
}
-
+ $contact_url = $item['self']?"":$a->get_baseurl() . '/contacts/' . $a->authors[$item['author-link']]['id'] ;
}
}