aboutsummaryrefslogtreecommitdiffstats
path: root/include/attach.php
diff options
context:
space:
mode:
authormarijus <mario@mariovavti.com>2015-01-24 12:22:04 +0100
committermarijus <mario@mariovavti.com>2015-01-24 12:22:04 +0100
commite4e990df06ef64dd08bdd6e6a78bf461dc97cc19 (patch)
tree425bb4ddae5385a2bddca0e19206b171f4cec849 /include/attach.php
parent43793540214ac6a578f8495c3cca41d831eb7536 (diff)
downloadvolse-hubzilla-e4e990df06ef64dd08bdd6e6a78bf461dc97cc19.tar.gz
volse-hubzilla-e4e990df06ef64dd08bdd6e6a78bf461dc97cc19.tar.bz2
volse-hubzilla-e4e990df06ef64dd08bdd6e6a78bf461dc97cc19.zip
the old item must be removed before the new is created
Diffstat (limited to 'include/attach.php')
-rw-r--r--include/attach.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/attach.php b/include/attach.php
index 9c71beb23..850f71f20 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -987,11 +987,18 @@ function file_activity($channel_id, $object, $allow_cid, $allow_gid, $deny_cid,
dbesc($jsonobject)
);
-
if($y) {
$update = true;
$object['d_mid'] = $y[0]['mid']; //attach mid of the old object
$u_jsonobject = json_encode($object);
+
+ //we have got the relevant info - delete the old item before we create the new one
+ $z = q("DELETE FROM item WHERE obj_type = '%s' AND verb = '%s' AND mid = '%s'",
+ dbesc(ACTIVITY_OBJ_FILE),
+ dbesc(ACTIVITY_POST),
+ dbesc($y[0]['mid'])
+ );
+
}
if($update && $verb == 'post' ) {