diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/attach.php | 2 | ||||
-rw-r--r-- | include/sharedwithme.php | 32 | ||||
-rw-r--r-- | include/text.php | 3 |
3 files changed, 34 insertions, 3 deletions
diff --git a/include/attach.php b/include/attach.php index 04fd25ace..1daa42aef 100644 --- a/include/attach.php +++ b/include/attach.php @@ -1078,7 +1078,7 @@ function file_activity($channel_id, $object, $allow_cid, $allow_gid, $deny_cid, $arr['deny_cid'] = perms2str($u_arr_deny_cid); $arr['deny_gid'] = perms2str($u_arr_deny_gid); $arr['item_restrict'] = ITEM_HIDDEN; - $arr['item_private'] = 0; + $arr['item_private'] = $private; $arr['verb'] = ACTIVITY_UPDATE; $arr['obj_type'] = $objtype; $arr['object'] = $u_jsonobject; diff --git a/include/sharedwithme.php b/include/sharedwithme.php new file mode 100644 index 000000000..3936dc90f --- /dev/null +++ b/include/sharedwithme.php @@ -0,0 +1,32 @@ +<?php + +function apply_updates() { + + //check for updated items and remove them + $x = q("SELECT mid, object FROM item WHERE verb = '%s' AND obj_type = '%s' GROUP BY mid", + dbesc(ACTIVITY_UPDATE), + dbesc(ACTIVITY_OBJ_FILE) + ); + + if($x) { + + foreach($x as $xx) { + + $object = json_decode($xx['object'],true); + + $d_mid = $object['d_mid']; + $u_mid = $xx['mid']; + + $y = q("DELETE FROM item WHERE obj_type = '%s' AND (verb = '%s' AND mid = '%s') OR (verb = '%s' AND mid = '%s')", + dbesc(ACTIVITY_OBJ_FILE), + dbesc(ACTIVITY_POST), + dbesc($d_mid), + dbesc(ACTIVITY_UPDATE), + dbesc($u_mid) + ); + + } + + } + +} diff --git a/include/text.php b/include/text.php index 54d8b2ad7..86da3ee42 100644 --- a/include/text.php +++ b/include/text.php @@ -2370,8 +2370,7 @@ function linkify_tags($a, &$body, $uid) { if($fullnametagged) continue; - // @FIXME which $profile_uid? It's not set anywhere. - $success = handle_tag($a, $body, $access_tag, $str_tags, ($uid) ? $uid : $profile_uid , $tag); + $success = handle_tag($a, $body, $access_tag, $str_tags, ($uid) ? $uid : $a->profile_uid , $tag); $results[] = array('success' => $success, 'access_tag' => $access_tag); if($success['replaced']) $tagged[] = $tag; } |