aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-01-10 12:37:48 -0800
committerfriendica <info@friendica.com>2014-01-10 12:37:48 -0800
commitc9879edb3e1c7058dca083b11a13840cf7cbe609 (patch)
tree7798985198b080d92d23412ea3f84978faed92bb /include
parent4e9866f6b20d3747b948b2eab3f6dfb23cc884e7 (diff)
downloadvolse-hubzilla-c9879edb3e1c7058dca083b11a13840cf7cbe609.tar.gz
volse-hubzilla-c9879edb3e1c7058dca083b11a13840cf7cbe609.tar.bz2
volse-hubzilla-c9879edb3e1c7058dca083b11a13840cf7cbe609.zip
break delivery loop if an item is deleted twice
Diffstat (limited to 'include')
-rw-r--r--include/reddav.php2
-rw-r--r--include/zot.php9
2 files changed, 9 insertions, 2 deletions
diff --git a/include/reddav.php b/include/reddav.php
index b2683885d..69fcf8bec 100644
--- a/include/reddav.php
+++ b/include/reddav.php
@@ -886,7 +886,7 @@ class RedBrowser extends DAV\Browser\Plugin {
<td><a href=\"{$fullPath}\">{$displayName}</a></td>
<td>{$type}</td>
<td>{$size}</td>
- <td>" . datetime_convert('UTC', date_default_timezone_get(),$lastmodified) . "</td>
+ <td>" . (($lastmodified) ? datetime_convert('UTC', date_default_timezone_get(),$lastmodified) : '') . "</td>
</tr>";
}
diff --git a/include/zot.php b/include/zot.php
index 168ccaaa5..7c2cfe019 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -1367,6 +1367,8 @@ function process_delivery($sender,$arr,$deliveries,$relay) {
// remove_community_tag is a no-op if this isn't a community tag activity
remove_community_tag($sender,$arr,$channel['channel_id']);
+
+
$item_id = delete_imported_item($sender,$arr,$channel['channel_id']);
$result[] = array($d['hash'],(($item_id) ? 'deleted' : 'delete_failed'),$channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>');
@@ -1524,7 +1526,7 @@ function delete_imported_item($sender,$item,$uid) {
logger('delete_imported_item invoked',LOGGER_DEBUG);
- $r = q("select id from item where ( author_xchan = '%s' or owner_xchan = '%s' or source_xchan = '%s' )
+ $r = q("select id, item_restrict from item where ( author_xchan = '%s' or owner_xchan = '%s' or source_xchan = '%s' )
and mid = '%s' and uid = %d limit 1",
dbesc($sender['hash']),
dbesc($sender['hash']),
@@ -1537,6 +1539,11 @@ function delete_imported_item($sender,$item,$uid) {
logger('delete_imported_item: failed: ownership issue');
return false;
}
+
+ if($r[0]['item_restrict'] & ITEM_DELETED) {
+ logger('delete_imported_item: item was already deleted');
+ return false;
+ }
require_once('include/items.php');
drop_item($r[0]['id'],false);