aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-01-30 20:49:54 -0800
committerfriendica <info@friendica.com>2012-01-30 20:49:54 -0800
commit4993f4f1d63bd82a6964d6a55bb364d2c7514df4 (patch)
tree33780bc55bf339db37e3fb55a68c8c85aa584578 /mod/item.php
parent95878a3e848f2498b2cb4ac39c7dd5879456e913 (diff)
downloadvolse-hubzilla-4993f4f1d63bd82a6964d6a55bb364d2c7514df4.tar.gz
volse-hubzilla-4993f4f1d63bd82a6964d6a55bb364d2c7514df4.tar.bz2
volse-hubzilla-4993f4f1d63bd82a6964d6a55bb364d2c7514df4.zip
allow plugin to abort message posting, fix half-duplex D* relationship
Diffstat (limited to 'mod/item.php')
-rwxr-xr-xmod/item.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/mod/item.php b/mod/item.php
index 99c01c54f..217f13c49 100755
--- a/mod/item.php
+++ b/mod/item.php
@@ -633,6 +633,20 @@ function item_post(&$a) {
call_hooks('post_local',$datarray);
+ if(x($datarray,'cancel')) {
+ logger('mod_item: post cancelled by plugin.');
+ if($return_path) {
+ goaway($a->get_baseurl() . "/" . $return_path);
+ }
+
+ $json = array('cancel' => 1);
+ if(x($_REQUEST,'jsreload') && strlen($_REQUEST['jsreload']))
+ $json['reload'] = $a->get_baseurl() . '/' . $_REQUEST['jsreload'];
+
+ echo json_encode($json);
+ killme();
+ }
+
if($orig_post) {
$r = q("UPDATE `item` SET `body` = '%s', `edited` = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1",