aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-01-28 19:24:36 -0800
committerfriendica <info@friendica.com>2013-01-28 19:24:36 -0800
commit95415bff69a6dba17d9aa3ff02707c94872e75e4 (patch)
tree8e48d4fc1a9179eaf52383a0ce701a48e3b26ffc /include
parent89c6fc939d9672df0ddb0aa5ba880d5abca689b7 (diff)
downloadvolse-hubzilla-95415bff69a6dba17d9aa3ff02707c94872e75e4.tar.gz
volse-hubzilla-95415bff69a6dba17d9aa3ff02707c94872e75e4.tar.bz2
volse-hubzilla-95415bff69a6dba17d9aa3ff02707c94872e75e4.zip
delete item should now mostly work
Diffstat (limited to 'include')
-rw-r--r--include/notifier.php6
-rw-r--r--include/zot.php17
2 files changed, 19 insertions, 4 deletions
diff --git a/include/notifier.php b/include/notifier.php
index dddf0aade..b22f77d91 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -204,7 +204,11 @@ function notifier_run($argv, $argc){
$r = fetch_post_tags($r);
$target_item = $r[0];
-
+
+ if($target_item['item_restrict'] & ITEM_DELETED)
+ logger('notifier: target item ITEM_DELETED', LOGGER_DEBUG);
+
+
$s = q("select * from channel where channel_id = %d limit 1",
intval($target_item['uid'])
);
diff --git a/include/zot.php b/include/zot.php
index ac18dfd41..8e3f0303e 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -910,8 +910,15 @@ function process_delivery($sender,$arr,$deliveries,$relay) {
}
if($arr['item_restrict'] & ITEM_DELETED) {
- delete_imported_item($sender,$arr,$channel['channel_id']);
+ $item_id = delete_imported_item($sender,$arr,$channel['channel_id']);
$result[] = array($d['hash'],'deleted');
+
+ if($relay && $item_id) {
+ logger('process_delivery: invoking relay');
+ proc_run('php','include/notifier.php','relay',intval($item_id));
+ $result[] = array($d['hash'],'relayed');
+ }
+
continue;
}
@@ -988,20 +995,24 @@ function update_imported_item($sender,$item,$uid) {
function delete_imported_item($sender,$item,$uid) {
- $r = q("select id from item where author_xchan = '%s' or owner_xchan = '%s'
+ logger('delete_imported_item invoked',LOGGER_DEBUG);
+
+ $r = q("select id from item where ( author_xchan = '%s' or owner_xchan = '%s' )
and uri = '%s' and uid = %d limit 1",
dbesc($sender['hash']),
dbesc($sender['hash']),
dbesc($item['uri']),
intval($uid)
);
+
if(! $r) {
logger('delete_imported_item: failed: ownership issue');
- return;
+ return false;
}
require_once('include/items.php');
drop_item($r[0]['id'],false);
+ return $r[0]['id'];
}
function process_mail_delivery($sender,$arr,$deliveries) {