else
$return_url = $_SESSION['return_url'] = $a->query_string;
- load_contact_links(local_user());
-
$cb = array('items' => $items, 'mode' => $mode, 'update' => $update, 'preview' => $preview);
call_hooks('conversation_start',$cb);
else
$profile_avatar = $item['author-avatar'];
- // This was the old method. We leave it here at the moment
- //$normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
- //if(($normalised != 'mailbox') && (x($a->contacts[$normalised])))
- // $profile_avatar = $a->contacts[$normalised]['thumb'];
- //else
- // $profile_avatar = $a->remove_baseurl(((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']));
-
$locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
call_hooks('render_location',$locate);
$clean_url = normalise_link($item['author-link']);
- if((local_user()) && (local_user() == $item['uid'])) {
- if(isset($a->contacts) && x($a->contacts,$clean_url)) {
- if($a->contacts[$clean_url]['network'] === NETWORK_DFRN) {
- $best_url = 'redir/'.$a->contacts[$clean_url]['id'];
- $sparkle = true;
- } else
- $best_url = $a->contacts[$clean_url]['url'];
- }
- } elseif (local_user()) {
+ if (local_user()) {
$r = q("SELECT `id` FROM `contact` WHERE `network` = '%s' AND `uid` = %d AND `nurl` = '%s' LIMIT 1",
dbesc(NETWORK_DFRN), intval(local_user()), dbesc(normalise_link($clean_url)));
if ($r) {
$ssl_state = false;
- if(local_user()) {
+ if(local_user())
$ssl_state = true;
- if(! count($a->contacts))
- load_contact_links(local_user());
- }
+
$sub_link="";
$poke_link="";
$contact_url="";
$status_link="";
$photos_link="";
$posts_link="";
+ $network = "";
if((local_user()) && local_user() == $item['uid'] && $item['parent'] == $item['id'] && (! $item['self'])) {
$sub_link = 'javascript:dosubthread(' . $item['id'] . '); return false;';
if($profile_link === 'mailbox')
$profile_link = '';
+ $cid = 0;
+ $network = "";
+ $rel = 0;
+ $r = q("SELECT `id`, `network`, `rel` FROM `contact` WHERE `uid` = %d AND `nurl` = '%s' LIMIT 1",
+ intval(local_user()), dbesc(normalise_link($item['author-link'])));
+ if ($r) {
+ $cid = $r[0]["id"];
+ $network = $r[0]["network"];
+ $rel = $r[0]["rel"];
+ }
+
if($sparkle) {
- $cid = intval(basename($profile_link));
- $status_link = $profile_link . "?url=status";
- $photos_link = $profile_link . "?url=photos";
- $profile_link = $profile_link . "?url=profile";
- $pm_url = 'message/new/' . $cid;
+ $status_link = $profile_link."?url=status";
+ $photos_link = $profile_link."?url=photos";
+ $profile_link = $profile_link."?url=profile";
$zurl = '';
- }
- else {
+ } else
$profile_link = zrl($profile_link);
- if(local_user() && local_user() == $item['uid'] && link_compare($item['url'],$item['author-link'])) {
- $cid = $item['contact-id'];
- } else {
- $r = q("SELECT `id`, `network` FROM `contact` WHERE `uid` = %d AND `nurl` = '%s' LIMIT 1",
- intval(local_user()), dbesc(normalise_link($item['author-link'])));
- if ($r) {
- $cid = $r[0]["id"];
-
- if ($r[0]["network"] == NETWORK_DIASPORA)
- $pm_url = 'message/new/' . $cid;
-
- } else
- $cid = 0;
- }
- }
- if(($cid) && (! $item['self'])) {
- $poke_link = 'poke/?f=&c=' . $cid;
- $contact_url = 'contacts/' . $cid;
- $posts_link = 'contacts/' . $cid . '/posts';
- $clean_url = normalise_link($item['author-link']);
-
- if((local_user()) && (local_user() == $item['uid'])) {
- if(isset($a->contacts) && x($a->contacts,$clean_url)) {
- if($a->contacts[$clean_url]['network'] === NETWORK_DIASPORA) {
- $pm_url = 'message/new/' . $cid;
- }
- }
- }
+ if($cid && !$item['self']) {
+ $poke_link = 'poke/?f=&c='.$cid;
+ $contact_url = 'contacts/'.$cid;
+ $posts_link = 'contacts/'.$cid.'/posts';
+ if (in_array($network, array(NETWORK_DFRN, NETWORK_DIASPORA)))
+ $pm_url = 'message/new/'.$cid;
}
if (local_user()) {
t("Send PM") => $pm_url
);
- if ($a->contacts[$clean_url]['network'] === NETWORK_DFRN)
+ if ($network == NETWORK_DFRN)
$menu[t("Poke")] = $poke_link;
- if ((($cid == 0) OR ($a->contacts[$clean_url]['rel'] == CONTACT_IS_FOLLOWER)) AND
+ if ((($cid == 0) OR ($rel == CONTACT_IS_FOLLOWER)) AND
in_array($item['network'], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA)))
$menu[t("Connect/Follow")] = "follow?url=".urlencode($item['author-link']);
} else
else
$profile_avatar = $item['author-avatar'];
- //$normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
- //if(($normalised != 'mailbox') && (x($a->contacts[$normalised])))
- // $profile_avatar = $a->contacts[$normalised]['thumb'];
- //else
- // $profile_avatar = $a->remove_baseurl(((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']));
-
$locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
call_hooks('render_location',$locate);
else
$profile_avatar = $item['author-avatar'];
- //$normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
- //if(($normalised != 'mailbox') && (x($a->contacts,$normalised)))
- // $profile_avatar = $a->contacts[$normalised]['thumb'];
- //else
- // $profile_avatar = $a->remove_baseurl(((strlen($item['author-avatar']) && $diff_author) ? $item['author-avatar'] : $thumb));
-
$like = ((x($alike,$item['uri'])) ? format_like($alike[$item['uri']],$alike[$item['uri'] . '-l'],'like',$item['uri']) : '');
$dislike = ((x($dlike,$item['uri'])) ? format_like($dlike[$item['uri']],$dlike[$item['uri'] . '-l'],'dislike',$item['uri']) : '');