allow plugin to abort message posting, fix half-duplex D* relationship

This commit is contained in:
friendica
2012-01-30 20:49:54 -08:00
parent 95878a3e84
commit 4993f4f1d6
3 changed files with 22 additions and 0 deletions
+14
View File
@@ -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",