diff options
author | friendica <info@friendica.com> | 2015-03-22 12:56:08 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2015-03-22 12:56:08 -0700 |
commit | b198cf69cdffd801651db12c05e5b4661ebe393f (patch) | |
tree | f64e25904a3a03f8b2662d363774d528e01b78ae /include/sharedwithme.php | |
parent | 6631540d20068d3c4ee221518e8f430507662e27 (diff) | |
parent | e72c3e3e058e6c275b7a50979ab12cfd79b8e7d3 (diff) | |
download | volse-hubzilla-b198cf69cdffd801651db12c05e5b4661ebe393f.tar.gz volse-hubzilla-b198cf69cdffd801651db12c05e5b4661ebe393f.tar.bz2 volse-hubzilla-b198cf69cdffd801651db12c05e5b4661ebe393f.zip |
Merge https://github.com/friendica/red into pending_merge
Diffstat (limited to 'include/sharedwithme.php')
-rw-r--r-- | include/sharedwithme.php | 32 |
1 files changed, 32 insertions, 0 deletions
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) + ); + + } + + } + +} |