- $profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $thumb);
-
- $profile_link = $profile_url;
+ $profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $item['thumb']);
+
+ $edpost = '';
+ if((local_user()) && ($item['uid'] == local_user()) && ($item['id'] == $item['parent']) && (intval($item['wall']) == 1))
+ $edpost = '<a class="editpost" href="' . $a->get_baseurl() . '/editpost/' . $item['id'] . '" title="' . t('Edit') . '"><img src="images/pencil.gif" /></a>';
+ // Can we use our special contact URL for this author?
+
+ if(strlen($item['author-link'])) {
+ $profile_link = $item['author-link'];
+ if(link_compare($item['author-link'],$item['url']) && ($item['network'] === 'dfrn') && (! $item['self'])) {
+ $profile_link = $redirect_url;
+ $sparkle = ' sparkle';
+ }
+ elseif(isset($author_contacts[$item['author-link']])) {
+ $profile_link = $a->get_baseurl() . '/redir/' . $author_contacts[$item['author-link']];
+ $sparkle = ' sparkle';
+ }
+ }