diff options
author | Mario Vavti <mario@mariovavti.com> | 2019-06-12 11:27:39 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2019-06-12 11:27:39 +0200 |
commit | decd0dc035cce0918519bef77742ff87db23e3f3 (patch) | |
tree | 552bd635f1a20b25e50837f18064ca0103f19278 /Zotlabs | |
parent | 9ac9c693adaa6d3262e1a8639c83474419059730 (diff) | |
download | volse-hubzilla-decd0dc035cce0918519bef77742ff87db23e3f3.tar.gz volse-hubzilla-decd0dc035cce0918519bef77742ff87db23e3f3.tar.bz2 volse-hubzilla-decd0dc035cce0918519bef77742ff87db23e3f3.zip |
more work on event item deletion
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Lib/Libzot.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 976ed22fa..ba9ffbead 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -2074,6 +2074,25 @@ class Libzot { return false; } + if ($item['obj_type'] == ACTIVITY_OBJ_EVENT) { + $i = q("SELECT * FROM event WHERE event_hash = '%s' AND uid = %d LIMIT 1", + dbesc($item['uuid']), + intval($uid) + ); + if ($i) { + if ($i[0]['event_xchan'] === $sender) { + q("delete from event where event_hash = '%s' and uid = %d", + dbesc($item['uuid']), + intval($uid) + ); + } + else { + logger('delete linked event: not owner'); + return; + } + } + } + if($item_found) { if(intval($r[0]['item_deleted'])) { logger('delete_imported_item: item was already deleted'); |