aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-04-04 05:52:59 -0700
committerFriendika <info@friendika.com>2011-04-04 05:52:59 -0700
commit742bdd3054408433f8d639acbb07d0fd9c3ad4f7 (patch)
tree641d08f437684bdadb0e1ff6268345b27be90f6b /boot.php
parent9f804b936a23c6c28307968c755eb920c26048cc (diff)
downloadvolse-hubzilla-742bdd3054408433f8d639acbb07d0fd9c3ad4f7.tar.gz
volse-hubzilla-742bdd3054408433f8d639acbb07d0fd9c3ad4f7.tar.bz2
volse-hubzilla-742bdd3054408433f8d639acbb07d0fd9c3ad4f7.zip
make photo menu work better on remote profile logins
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/boot.php b/boot.php
index f1db7a349..68025d822 100644
--- a/boot.php
+++ b/boot.php
@@ -2686,10 +2686,16 @@ function item_photo_menu($item){
$photo_link="";
$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.
+ // 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.
+ // 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(strlen($item['author-link'])) {
+ if(((local_user() && (! $contact_uid)) || ($contact_uid && $contact_uid == 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";