function visible_activity($item) {
- if(activity_match($child['verb'],ACTIVITY_LIKE) || activity_match($child['verb'],ACTIVITY_DISLIKE))
+ if(activity_match($item['verb'],ACTIVITY_LIKE) || activity_match($item['verb'],ACTIVITY_DISLIKE))
return false;
- if(activity_match($item['verb'],ACTIVITY_FOLLOW) && $item['object-type'] === ACTIVITY_OBJ_NOTE && $item['uid'] != local_user())
- return false;
+ if(activity_match($item['verb'],ACTIVITY_FOLLOW) && $item['object-type'] === ACTIVITY_OBJ_NOTE) {
+ if(! (($item['self']) && ($item['uid'] == local_user()))) {
+ return false;
+ }
+ }
return true;
}
if(! count($a->contacts))
load_contact_links(local_user());
}
+ $sub_link="";
$poke_link="";
$contact_url="";
$pm_url="";
$photos_link="";
$posts_link="";
+ if((local_user()) && local_user() == $item['uid'] && $item['parent'] == $item['id'] && (! $item['self'])) {
+ $sub_link = 'javascript:dosubthread(' . $item['id'] . '); return false;';
+ }
+
$sparkle = false;
$profile_link = best_link_url($item,$sparkle,$ssl_state);
if($profile_link === 'mailbox')
}
$menu = Array(
+ t("Follow Thread") => $sub_link,
t("View Status") => $status_link,
t("View Profile") => $profile_link,
t("View Photos") => $photos_link,
$o = "";
foreach($menu as $k=>$v){
- if ($v!="") $o .= "<li><a href=\"$v\">$k</a></li>\n";
+ if(strpos($v,'javascript:') === 0) {
+ $v = substr($v,11);
+ $o .= "<li><a href=\"#\" onclick=\"$v\">$k</a></li>\n";
+ }
+ elseif ($v!="") $o .= "<li><a href=\"$v\">$k</a></li>\n";
}
return $o;
}}
unpause();
$('#like-rotator-' + ident.toString()).show();
$.get('like/' + ident.toString() + '?verb=' + verb, NavUpdate );
-// if(timer) clearTimeout(timer);
-// timer = setTimeout(NavUpdate,3000);
liking = 1;
}
+ function dosubthread(ident) {
+ unpause();
+ $('#like-rotator-' + ident.toString()).show();
+ $.get('subthread/' + ident.toString(), NavUpdate );
+ liking = 1;
+ }
+
+
function dostar(ident) {
ident = ident.toString();
$('#like-rotator-' + ident).show();
if($item['network'] === NETWORK_MAIL && local_user() != $item['uid']) {
continue;
}
- if($item['verb'] === ACTIVITY_LIKE || $item['verb'] === ACTIVITY_DISLIKE) {
+ if(! visible_activity($item)) {
continue;
}
$child = new Item($item);
* Only add what will be displayed
*/
if($item->get_data_value('network') === NETWORK_MAIL && local_user() != $item->get_data_value('uid')) {
- logger('[WARN] Item::add_child : Item is a mail ('. $item->get_id() .').', LOGGER_DEBUG);
return false;
}
- if($item->get_data_value('verb') === ACTIVITY_LIKE || $item->get_data_value('verb') === ACTIVITY_DISLIKE) {
- logger('[WARN] Item::add_child : Item is a (dis)like ('. $item->get_id() .').', LOGGER_DEBUG);
+ if(activity_match($item->get_data_value('verb'),ACTIVITY_LIKE) || activity_match($item->get_data_value('verb'),ACTIVITY_DISLIKE)) {
return false;
}
private function is_visiting() {
return $this->visiting;
}
+
+
+
+
}
?>