From 848e3f6c5d2aa10025fae11d1344c09c9adb84f9 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 28 Oct 2015 19:43:35 -0700 Subject: photos linked item visibility issue --- include/items.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index 08be981e7..ce8e2b9b0 100755 --- a/include/items.php +++ b/include/items.php @@ -4792,7 +4792,7 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C if($arr['mid']) $sql_options .= " and parent_mid = '" . dbesc($arr['mid']) . "' "; - $sql_extra = " AND item.parent IN ( SELECT parent FROM item WHERE item_thread_top = 1 $sql_options ) "; + $sql_extra = " AND item.parent IN ( SELECT parent FROM item WHERE item_thread_top = 1 $sql_options $item_normal ) "; if($arr['since_id']) $sql_extra .= " and item.id > " . $since_id . " "; -- cgit v1.2.3 From 5f801216373078817d39b8aea34dd5fa7949dc6a Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 30 Oct 2015 22:43:38 -0700 Subject: add hubloc repair script (needed for deadsuperhero, probably temporary) --- include/items.php | 1 + 1 file changed, 1 insertion(+) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index ce8e2b9b0..4d8fce60f 100755 --- a/include/items.php +++ b/include/items.php @@ -3455,6 +3455,7 @@ function post_is_importable($item,$abook) { $text = prepare_text($item['body'],$item['mimetype']); $text = html2plain($text); + $lang = null; if((strpos($abook['abook_incl'],'lang=') !== false) || (strpos($abook['abook_excl'],'lang=') !== false)) { -- cgit v1.2.3 From 2c299a9f379b9e8af33cae4270ec1c0c5cf2bc99 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 3 Nov 2015 14:59:14 -0800 Subject: implement unfollow thread --- include/items.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index 4d8fce60f..3e4805212 100755 --- a/include/items.php +++ b/include/items.php @@ -2837,6 +2837,8 @@ function store_diaspora_comment_sig($datarray, $channel, $parent_item, $post_id, function send_status_notifications($post_id,$item) { $notify = false; + $unfollowed = false; + $parent = 0; $r = q("select channel_hash from channel where channel_id = %d limit 1", @@ -2864,6 +2866,14 @@ function send_status_notifications($post_id,$item) { foreach($x as $xx) { if($xx['author_xchan'] === $r[0]['channel_hash']) { $notify = true; + + // check for an unfollow thread activity - we should probably decode the obj and check the id + // but it will be extremely rare for this to be wrong. + + if(($xx['verb'] === ACTIVITY_UNFOLLOW) + && ($xx['obj_type'] === ACTIVITY_OBJ_NOTE || $xx['obj_type'] === ACTIVITY_OBJ_PHOTO) + && ($xx['parent'] != $xx['id'])) + $unfollowed = true; } if($xx['id'] == $xx['parent']) { $parent = $xx['parent']; @@ -2871,6 +2881,9 @@ function send_status_notifications($post_id,$item) { } } + if($unfollowed) + return; + $link = get_app()->get_baseurl() . '/display/' . $item['mid']; $y = q("select id from notify where link = '%s' and uid = %d limit 1", -- cgit v1.2.3