aboutsummaryrefslogtreecommitdiffstats
path: root/include/sharedwithme.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2015-03-22 16:29:57 +0100
committerMario Vavti <mario@mariovavti.com>2015-03-22 16:29:57 +0100
commite345d6793d5f6910dd230f661ca5d1a837b1b504 (patch)
treea2ecee4e65bc80300c62b5b327965b8118117ad3 /include/sharedwithme.php
parent47c055e7f39ed4524dae6f0da2f0c64412f794d9 (diff)
downloadvolse-hubzilla-e345d6793d5f6910dd230f661ca5d1a837b1b504.tar.gz
volse-hubzilla-e345d6793d5f6910dd230f661ca5d1a837b1b504.tar.bz2
volse-hubzilla-e345d6793d5f6910dd230f661ca5d1a837b1b504.zip
move the maintenance part to include/sharedwithme.php
Diffstat (limited to 'include/sharedwithme.php')
-rw-r--r--include/sharedwithme.php32
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)
+ );
+
+ }
+
+ }
+
+}