aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-05-19 18:26:46 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-05-19 18:26:46 -0700
commitd63bcde6e20fbbc31bc53c4d92058141657ca4e1 (patch)
tree4f22d14075c05941842b088f722a7599eb4cd110
parentc78869e437eecfe7e30f728c3726341b60fe7803 (diff)
parentfe00d29047da1cb99cbc06af938268ec9e6a8fcb (diff)
downloadvolse-hubzilla-d63bcde6e20fbbc31bc53c4d92058141657ca4e1.tar.gz
volse-hubzilla-d63bcde6e20fbbc31bc53c4d92058141657ca4e1.tar.bz2
volse-hubzilla-d63bcde6e20fbbc31bc53c4d92058141657ca4e1.zip
Merge branch 'master' of https://github.com/redmatrix/redmatrix
-rw-r--r--mod/impel.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/mod/impel.php b/mod/impel.php
index 930158589..65d5d2e7a 100644
--- a/mod/impel.php
+++ b/mod/impel.php
@@ -91,10 +91,11 @@ function impel_init(&$a) {
dbesc($namespace),
intval(local_channel())
);
- $i = q("select id from item where mid = '%s' and uid = %d limit 1",
+ $i = q("select id, item_restrict from item where mid = '%s' and uid = %d limit 1",
dbesc($arr['mid']),
intval(local_channel())
);
+
if($z && $i) {
$remote_id = $z[0]['id'];
$arr['id'] = $i[0]['id'];
@@ -103,6 +104,13 @@ function impel_init(&$a) {
$x = item_store_update($arr,$execflag);
}
else {
+ if(($i) && ($i[0]['item_restrict'] & ITEM_DELETED)) {
+ // was partially deleted already, finish it off
+ q("delete from item where mid = '%s' and uid = %d",
+ dbesc($arr['mid']),
+ intval(local_channel())
+ );
+ }
$x = item_store($arr,$execflag);
}
if($x['success'])