aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2016-12-01 14:15:34 -0800
committerzotlabs <mike@macgirvin.com>2016-12-01 14:15:34 -0800
commit141b8495e2a40dcf8c11615c2db681cd9a3d9d69 (patch)
tree8c139f8228b7833bc506f00a72f3026925f4f859 /include
parent6c5795b519bb2ace29d8361fcad45b8d4a530035 (diff)
downloadvolse-hubzilla-141b8495e2a40dcf8c11615c2db681cd9a3d9d69.tar.gz
volse-hubzilla-141b8495e2a40dcf8c11615c2db681cd9a3d9d69.tar.bz2
volse-hubzilla-141b8495e2a40dcf8c11615c2db681cd9a3d9d69.zip
allow plugins to cancel item_store() and item_store_update()
Diffstat (limited to 'include')
-rwxr-xr-xinclude/items.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/items.php b/include/items.php
index 4ac4d6049..e20c41d29 100755
--- a/include/items.php
+++ b/include/items.php
@@ -1463,6 +1463,11 @@ function item_store($arr, $allow_exec = false, $deliver = true) {
$ret = array('success' => false, 'item_id' => 0);
+ if(array_key_exists('cancel',$arr) && $arr['cancel']) {
+ logger('cancelled by plugin');
+ return $ret;
+ }
+
if(! $arr['uid']) {
logger('item_store: no uid');
$ret['message'] = 'No uid.';
@@ -1881,6 +1886,12 @@ function item_store_update($arr,$allow_exec = false, $deliver = true) {
$allow_exec = $d['allow_exec'];
$ret = array('success' => false, 'item_id' => 0);
+
+ if(array_key_exists('cancel',$arr) && $arr['cancel']) {
+ logger('cancelled by plugin');
+ return $ret;
+ }
+
if(! intval($arr['uid'])) {
logger('item_store_update: no uid');
$ret['message'] = 'no uid.';