aboutsummaryrefslogtreecommitdiffstats
path: root/include/conversation.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-10-01 18:02:11 -0700
committerfriendica <info@friendica.com>2012-10-01 18:02:11 -0700
commit846a9813b23911ae2a87d87fb6fd9f188ed84dc0 (patch)
treea8a78b379cc8f4e25812c5b2cac603c86b6b1472 /include/conversation.php
parentd261fe271fdee747244c76f7ba4679b8372a2e8c (diff)
downloadvolse-hubzilla-846a9813b23911ae2a87d87fb6fd9f188ed84dc0.tar.gz
volse-hubzilla-846a9813b23911ae2a87d87fb6fd9f188ed84dc0.tar.bz2
volse-hubzilla-846a9813b23911ae2a87d87fb6fd9f188ed84dc0.zip
here's where the heavy lifting begins - everything is likely to be broken for quite some time as we add location and db independence to items and conversations and work through the rest of the permissions and how to federate the buggers.
Diffstat (limited to 'include/conversation.php')
-rw-r--r--include/conversation.php45
1 files changed, 29 insertions, 16 deletions
diff --git a/include/conversation.php b/include/conversation.php
index 621032349..bad511551 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -111,7 +111,7 @@ function localize_item(&$item){
}
break;
default:
- if($obj['resource-id']){
+ if($obj['resource_id']){
$post_type = t('photo');
$m=array(); preg_match("/\[url=([^]]*)\]/", $obj['body'], $m);
$rr['plink'] = $m[1];
@@ -239,7 +239,7 @@ function localize_item(&$item){
}
break;
default:
- if($obj['resource-id']){
+ if($obj['resource_id']){
$post_type = t('photo');
$m=array(); preg_match("/\[url=([^]]*)\]/", $obj['body'], $m);
$rr['plink'] = $m[1];
@@ -329,11 +329,14 @@ function count_descendants($item) {
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;
}
@@ -1372,6 +1375,7 @@ function item_photo_menu($item){
if(! count($a->contacts))
load_contact_links(local_user());
}
+ $sub_link="";
$poke_link="";
$contact_url="";
$pm_url="";
@@ -1379,6 +1383,10 @@ function item_photo_menu($item){
$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);
@@ -1417,6 +1425,7 @@ 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,
@@ -1435,7 +1444,11 @@ function item_photo_menu($item){
$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;
}}
@@ -1456,16 +1469,16 @@ function like_puller($a,$item,&$arr,$mode) {
else
$url = zrl($url);
- if(! $item['thr-parent'])
- $item['thr-parent'] = $item['parent_uri'];
+ if(! $item['thr_parent'])
+ $item['thr_parent'] = $item['parent_uri'];
- if(! ((isset($arr[$item['thr-parent'] . '-l'])) && (is_array($arr[$item['thr-parent'] . '-l']))))
- $arr[$item['thr-parent'] . '-l'] = array();
- if(! isset($arr[$item['thr-parent']]))
- $arr[$item['thr-parent']] = 1;
+ if(! ((isset($arr[$item['thr_parent'] . '-l'])) && (is_array($arr[$item['thr_parent'] . '-l']))))
+ $arr[$item['thr_parent'] . '-l'] = array();
+ if(! isset($arr[$item['thr_parent']]))
+ $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']] ++;
+ $arr[$item['thr_parent'] . '-l'][] = '<a href="'. $url . '"'. $sparkle .'>' . $item['author-name'] . '</a>';
}
return;
}}
@@ -1603,8 +1616,8 @@ function get_item_children($arr, $parent) {
foreach($arr as $item) {
if($item['id'] != $item['parent']) {
if(get_config('system','thread_allow')) {
- // Fallback to parent_uri if thr-parent is not set
- $thr_parent = $item['thr-parent'];
+ // Fallback to parent_uri if thr_parent is not set
+ $thr_parent = $item['thr_parent'];
if($thr_parent == '')
$thr_parent = $item['parent_uri'];