]> git.mxchange.org Git - friendica.git/blobdiff - include/conversation.php
Merge pull request #1950 from annando/1510-contact-menu
[friendica.git] / include / conversation.php
index bbb0b921a344051b4668dfe1beac007a51a6a7f6..107fb84ea94dd1e5cd092bb5581d8f598c9e07ac 100644 (file)
@@ -884,21 +884,25 @@ function item_photo_menu($item){
 
        }
 
-       $menu = Array(
-               t("Follow Thread") => $sub_link,
-               t("View Status") => $status_link,
-               t("View Profile") => $profile_link,
-               t("View Photos") => $photos_link,
-               t("Network Posts") => $posts_link,
-               t("Edit Contact") => $contact_url,
-               t("Send PM") => $pm_url
-       );
-
-       if ($a->contacts[$clean_url]['network'] === NETWORK_DFRN)
-               $menu[t("Poke")] = $poke_link;
-
-       if (($cid == 0) AND in_array($item['network'], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA)))
-               $menu[t("Connect/Follow")] = $a->get_baseurl($ssl_state)."/follow?url=".urlencode($item['author-link']);
+       if (local_user()) {
+               $menu = Array(
+                       t("Follow Thread") => $sub_link,
+                       t("View Status") => $status_link,
+                       t("View Profile") => $profile_link,
+                       t("View Photos") => $photos_link,
+                       t("Network Posts") => $posts_link,
+                       t("Edit Contact") => $contact_url,
+                       t("Send PM") => $pm_url
+               );
+
+               if ($a->contacts[$clean_url]['network'] === NETWORK_DFRN)
+                       $menu[t("Poke")] = $poke_link;
+
+               if ((($cid == 0) OR ($a->contacts[$clean_url]['rel'] == CONTACT_IS_FOLLOWER)) AND
+                       in_array($item['network'], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA)))
+                       $menu[t("Connect/Follow")] = $a->get_baseurl($ssl_state)."/follow?url=".urlencode($item['author-link']);
+       } else
+               $menu = array(t("View Profile") => $item['author-link']);
 
        $args = array('item' => $item, 'menu' => $menu);
 
@@ -942,7 +946,7 @@ function like_puller($a,$item,&$arr,$mode) {
                        $arr[$item['thr-parent']] = 1;
                else
                        $arr[$item['thr-parent']] ++;
-               $arr[$item['thr-parent'] . '-l'][] = '<a href="'. $url . '"'. $sparkle .'>' . $item['author-name'] . '</a>';
+               $arr[$item['thr-parent'] . '-l'][] = '<a href="'. $url . '"'. $sparkle .'>' . htmlentities($item['author-name']) . '</a>';
        }
        return;
 }}
@@ -958,7 +962,7 @@ if(! function_exists('format_like')) {
 function format_like($cnt,$arr,$type,$id) {
        $o = '';
        if($cnt == 1)
-               $o .= (($type === 'like') ? sprintf( t('%s likes this.'), $arr[0]) : sprintf( t('%s doesn\'t like this.'), $arr[0])) . EOL ;
+               $o .= (($type === 'like') ? sprintf( t('%s likes this.'), $arr[0]) : sprintf( t('%s doesn\'t like this.'), $arr[0])) . EOL;
        else {
                $spanatts = "class=\"fakelink\" onclick=\"openClose('{$type}list-$id');\"";
                switch($type) {