From 4993f4f1d63bd82a6964d6a55bb364d2c7514df4 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 30 Jan 2012 20:49:54 -0800 Subject: allow plugin to abort message posting, fix half-duplex D* relationship --- mod/dfrn_confirm.php | 3 +++ mod/item.php | 14 ++++++++++++++ 2 files changed, 17 insertions(+) (limited to 'mod') diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index 89b09ef77..26314f39b 100755 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -370,6 +370,9 @@ function dfrn_confirm_post(&$a,$handsfree = null) { if($network === NETWORK_DIASPORA) { if($duplex) $new_relation = CONTACT_IS_FRIEND; + else + $new_relation = CONTACT_IS_SHARING; + if($new_relation != CONTACT_IS_FOLLOWER) $writable = 1; } 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", -- cgit v1.2.3