thread_author_menu - add some more checks as to whether to show certain links. This should complete work on hubzilla issue #1052

This commit is contained in:
zotlabs 2018-05-09 21:08:12 -07:00
parent d41556a1ea
commit b4be1da91e

View File

@ -1001,18 +1001,21 @@ function thread_author_menu($item, $mode = '') {
$profile_link = chanlink_hash($item['author_xchan']); $profile_link = chanlink_hash($item['author_xchan']);
$contact = false; $contact = false;
if(App::$contacts && array_key_exists($item['author_xchan'],App::$contacts)) if($channel['channel_hash'] !== $item['author_xchan']) {
$contact = App::$contacts[$item['author_xchan']]; if(App::$contacts && array_key_exists($item['author_xchan'],App::$contacts)) {
else $contact = App::$contacts[$item['author_xchan']];
if($local_channel && $item['author']['xchan_addr']) }
$follow_url = z_root() . '/follow/?f=&url=' . urlencode($item['author']['xchan_addr']) . '&interactive=0'; else {
if($local_channel && $item['author']['xchan_addr'] && (! in_array($item['author']['xchan_network'],[ 'rss', 'anon','unknown' ]))) {
$follow_url = z_root() . '/follow/?f=&url=' . urlencode($item['author']['xchan_addr']) . '&interactive=0';
}
}
if($item['uid'] > 0 && author_is_pmable($item['author'],$contact)) { if($item['uid'] > 0 && author_is_pmable($item['author'],$contact)) {
$pm_url = z_root() . '/mail/new/?f=&hash=' . urlencode($item['author_xchan']); $pm_url = z_root() . '/mail/new/?f=&hash=' . urlencode($item['author_xchan']);
}
} }
if($contact) { if($contact) {
$poke_link = z_root() . '/poke/?f=&c=' . $contact['abook_id']; $poke_link = z_root() . '/poke/?f=&c=' . $contact['abook_id'];
if (! intval($contact['abook_self'])) if (! intval($contact['abook_self']))