aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authormarijus <mario@mariovavti.com>2015-01-24 01:13:02 +0100
committermarijus <mario@mariovavti.com>2015-01-24 01:13:02 +0100
commit0cbe64c3606312302ad5d3ef56df5d152983ee4e (patch)
tree3f9fae671f62ca736426cb9339fdc6aa144dffcc /mod
parentea209a84ab946ee320c1f1cc39b667e9da23abe6 (diff)
downloadvolse-hubzilla-0cbe64c3606312302ad5d3ef56df5d152983ee4e.tar.gz
volse-hubzilla-0cbe64c3606312302ad5d3ef56df5d152983ee4e.tar.bz2
volse-hubzilla-0cbe64c3606312302ad5d3ef56df5d152983ee4e.zip
some more kiss
Diffstat (limited to 'mod')
-rw-r--r--mod/sharedwithme.php39
1 files changed, 9 insertions, 30 deletions
diff --git a/mod/sharedwithme.php b/mod/sharedwithme.php
index bbb9c2aef..8b7d2661c 100644
--- a/mod/sharedwithme.php
+++ b/mod/sharedwithme.php
@@ -24,38 +24,17 @@ function sharedwithme_content(&$a) {
foreach($x as $xx) {
$object = json_decode($xx['object'],true);
- $hash = $object['hash'];
- //If object has a mid it's an update activity - the inlcuded mid is the latest and should not be removed
- $update = (($object['mid']) ? true : false);
+ $d_mid = $object['d_mid'];
+ $u_mid = $xx['mid'];
- if($update) {
-
- $mid = $object['mid'];
-
- unset($object['mid']); //remove mid from object to match the post activity object
-
- $y = q("DELETE FROM item WHERE (mid != '%s' AND obj_type = '%s') AND (object = '%s' AND verb = '%s') OR (object = '%s' AND verb = '%s')",
- dbesc($mid),
- dbesc(ACTIVITY_OBJ_FILE),
- dbesc(json_encode($object)),
- dbesc(ACTIVITY_POST),
- dbesc($xx['object']),
- dbesc(ACTIVITY_UPDATE)
- );
-
- }
-
- else {
-
- $z = q("DELETE FROM item WHERE (obj_type = '%s' AND object = '%s') AND (verb = '%s' OR verb = '%s')",
- dbesc(ACTIVITY_OBJ_FILE),
- dbesc($xx['object']),
- dbesc(ACTIVITY_POST),
- dbesc(ACTIVITY_UPDATE)
- );
-
- }
+ $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)
+ );
}