Ther eis now a user setting to disabled notices. The Diaspora reshare now checks for empty values.

This commit is contained in:
Michael Vogel 2014-04-26 02:22:30 +02:00
parent e75562cd6d
commit 2846dfeb05
5 changed files with 16 additions and 4 deletions

View file

@ -1255,6 +1255,10 @@ if(! function_exists('info')) {
*/
function info($s) {
$a = get_app();
if (local_user() AND get_pconfig(local_user(),'system','ignore_info'))
return;
if(! x($_SESSION,'sysmsg_info')) $_SESSION['sysmsg_info'] = array();
if($a->interactive)
$_SESSION['sysmsg_info'][] = $s;

View file

@ -2341,7 +2341,7 @@ function diaspora_send_status($item,$owner,$contact,$public_batch = false) {
$return_code = diaspora_transmit($owner,$contact,$slap,$public_batch);
logger('diaspora_send_status: guid: '.$item['guid'].' root_guid: '.$ret['root_guid'].' result '.$return_code, LOGGER_DEBUG);
logger('diaspora_send_status: guid: '.$item['guid'].' result '.$return_code, LOGGER_DEBUG);
if(count($images)) {
diaspora_send_images($item,$owner,$contact,$images,$public_batch);
@ -2379,7 +2379,7 @@ function diaspora_is_reshare($body) {
$ret= array();
$ret["root_handle"] = preg_replace("=https?://(.*)/u/(.*)=ism", "$2@$1", $profile);
if ($ret["root_handle"] == $profile)
if (($ret["root_handle"] == $profile) OR ($ret["root_handle"] == ""))
return(false);
$link = "";
@ -2392,7 +2392,7 @@ function diaspora_is_reshare($body) {
$link = $matches[1];
$ret["root_guid"] = preg_replace("=https?://(.*)/posts/(.*)=ism", "$2", $link);
if ($ret["root_guid"] == $link)
if (($ret["root_guid"] == $link) OR ($ret["root_guid"] == ""))
return(false);
return($ret);

View file

@ -265,6 +265,7 @@ function settings_post(&$a) {
$theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : $a->user['theme']);
$mobile_theme = ((x($_POST,'mobile_theme')) ? notags(trim($_POST['mobile_theme'])) : '');
$nosmile = ((x($_POST,'nosmile')) ? intval($_POST['nosmile']) : 0);
$noinfo = ((x($_POST,'noinfo')) ? intval($_POST['noinfo']) : 0);
$infinite_scroll = ((x($_POST,'infinite_scroll')) ? intval($_POST['infinite_scroll']) : 0);
$browser_update = ((x($_POST,'browser_update')) ? intval($_POST['browser_update']) : 0);
$browser_update = $browser_update * 1000;
@ -287,6 +288,7 @@ function settings_post(&$a) {
set_pconfig(local_user(),'system','itemspage_network', $itemspage_network);
set_pconfig(local_user(),'system','itemspage_mobile_network', $itemspage_mobile_network);
set_pconfig(local_user(),'system','no_smilies',$nosmile);
set_pconfig(local_user(),'system','ignore_info',$noinfo);
set_pconfig(local_user(),'system','infinite_scroll',$infinite_scroll);
@ -850,6 +852,9 @@ function settings_content(&$a) {
$nosmile = get_pconfig(local_user(),'system','no_smilies');
$nosmile = (($nosmile===false)? '0': $nosmile); // default if not set: 0
$noinfo = get_pconfig(local_user(),'system','ignore_info');
$noinfo = (($noinfo===false)? '0': $noinfo); // default if not set: 0
$infinite_scroll = get_pconfig(local_user(),'system','infinite_scroll');
$infinite_scroll = (($infinite_scroll===false)? '0': $infinite_scroll); // default if not set: 0
@ -873,6 +878,7 @@ function settings_content(&$a) {
'$itemspage_network' => array('itemspage_network', t("Number of items to display per page:"), $itemspage_network, t('Maximum of 100 items')),
'$itemspage_mobile_network' => array('itemspage_mobile_network', t("Number of items to display per page when viewed from mobile device:"), $itemspage_mobile_network, t('Maximum of 100 items')),
'$nosmile' => array('nosmile', t("Don't show emoticons"), $nosmile, ''),
'$noinfo' => array('noinfo', t("Don't show notices"), $noinfo, ''),
'$infinite_scroll' => array('infinite_scroll', t("Infinite scroll"), $infinite_scroll, ''),
'$theme_config' => $theme_config,

View file

@ -14,6 +14,7 @@
{{include file="field_input.tpl" field=$itemspage_mobile_network}}
{{include file="field_input.tpl" field=$ajaxint}}
{{include file="field_checkbox.tpl" field=$nosmile}}
{{include file="field_checkbox.tpl" field=$noinfo}}
{{include file="field_checkbox.tpl" field=$infinite_scroll}}

View file

@ -1425,8 +1425,9 @@ h2 {
/* width: 700px; */
width: 100%;
padding: 0;
margin: 10px 0;
margin: 10px 0px 0px 0px;
border-bottom: 0px;
box-shadow: none;
}
.wall-item-bottom .comment-edit-preview {