From 3648094927d85a01eb5ee9d0a17dbc1450bfea0b Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 12 Nov 2015 21:43:42 +0100 Subject: [PATCH 1/3] Local delivery of comments to soap boxes are working now --- include/delivery.php | 4 ++-- include/notifier.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/delivery.php b/include/delivery.php index 659add2ad6..51ffe48d7a 100644 --- a/include/delivery.php +++ b/include/delivery.php @@ -342,8 +342,8 @@ function delivery_run(&$argv, &$argc){ // If we are setup as a soapbox we aren't accepting input from this person - if($x[0]['page-flags'] == PAGE_SOAPBOX) - break; + //if($x[0]['page-flags'] == PAGE_SOAPBOX) + // break; require_once('library/simplepie/simplepie.inc'); logger('mod-delivery: local delivery'); diff --git a/include/notifier.php b/include/notifier.php index 0f9cc80464..79bf7d51c8 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -736,8 +736,8 @@ function notifier_run(&$argv, &$argc){ // If we are setup as a soapbox we aren't accepting input from this person - if($x[0]['page-flags'] == PAGE_SOAPBOX) - break; + //if($x[0]['page-flags'] == PAGE_SOAPBOX) + // break; require_once('library/simplepie/simplepie.inc'); logger('mod-delivery: local delivery'); From 1ea82ea355e15674766d313fa534b185ec2b0da5 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 12 Nov 2015 21:55:33 +0100 Subject: [PATCH 2/3] Only allow non top level posts to soap boxes --- include/delivery.php | 6 +++--- include/notifier.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/delivery.php b/include/delivery.php index 51ffe48d7a..cdd59451f0 100644 --- a/include/delivery.php +++ b/include/delivery.php @@ -340,10 +340,10 @@ function delivery_run(&$argv, &$argc){ $ssl_policy = get_config('system','ssl_policy'); fix_contact_ssl_policy($x[0],$ssl_policy); - // If we are setup as a soapbox we aren't accepting input from this person + // If we are setup as a soapbox we aren't accepting top level posts from this person - //if($x[0]['page-flags'] == PAGE_SOAPBOX) - // break; + if (($x[0]['page-flags'] == PAGE_SOAPBOX) AND $top_level) + break; require_once('library/simplepie/simplepie.inc'); logger('mod-delivery: local delivery'); diff --git a/include/notifier.php b/include/notifier.php index 79bf7d51c8..9dac5f114b 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -734,10 +734,10 @@ function notifier_run(&$argv, &$argc){ $ssl_policy = get_config('system','ssl_policy'); fix_contact_ssl_policy($x[0],$ssl_policy); - // If we are setup as a soapbox we aren't accepting input from this person + // If we are setup as a soapbox we aren't accepting top level posts from this person - //if($x[0]['page-flags'] == PAGE_SOAPBOX) - // break; + if (($x[0]['page-flags'] == PAGE_SOAPBOX) AND $top_level) + break; require_once('library/simplepie/simplepie.inc'); logger('mod-delivery: local delivery'); From 5a8d66e2d4315a00eb45dec4b7f5fb88ed3dbc02 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 12 Nov 2015 23:34:33 +0100 Subject: [PATCH 3/3] Just removed blanks with tabs --- mod/wall_upload.php | 56 ++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/mod/wall_upload.php b/mod/wall_upload.php index 8e7eaa027f..8bf471d3d2 100644 --- a/mod/wall_upload.php +++ b/mod/wall_upload.php @@ -16,10 +16,10 @@ function wall_upload_post(&$a, $desktopmode = true) { ); if(! count($r)){ - if ($r_json) { - echo json_encode(array('error'=>t('Invalid request.'))); - killme(); - } + if ($r_json) { + echo json_encode(array('error'=>t('Invalid request.'))); + killme(); + } return; } } else { @@ -29,10 +29,10 @@ function wall_upload_post(&$a, $desktopmode = true) { ); } } else { - if ($r_json) { - echo json_encode(array('error'=>t('Invalid request.'))); - killme(); - } + if ($r_json) { + echo json_encode(array('error'=>t('Invalid request.'))); + killme(); + } return; } @@ -73,18 +73,18 @@ function wall_upload_post(&$a, $desktopmode = true) { if(! $can_post) { - if ($r_json) { - echo json_encode(array('error'=>t('Permission denied.'))); - killme(); - } + if ($r_json) { + echo json_encode(array('error'=>t('Permission denied.'))); + killme(); + } notice( t('Permission denied.') . EOL ); killme(); } if(! x($_FILES,'userfile') && ! x($_FILES,'media')){ - if ($r_json) { - echo json_encode(array('error'=>t('Invalid request.'))); - } + if ($r_json) { + echo json_encode(array('error'=>t('Invalid request.'))); + } killme(); } @@ -118,10 +118,10 @@ function wall_upload_post(&$a, $desktopmode = true) { } if ($src=="") { - if ($r_json) { - echo json_encode(array('error'=>t('Invalid request.'))); - killme(); - } + if ($r_json) { + echo json_encode(array('error'=>t('Invalid request.'))); + killme(); + } notice(t('Invalid request.').EOL); killme(); } @@ -243,9 +243,9 @@ function wall_upload_post(&$a, $desktopmode = true) { $r = q("SELECT `id`, `datasize`, `width`, `height`, `type` FROM `photo` WHERE `resource-id` = '%s' ORDER BY `width` DESC LIMIT 1", $hash); if (!$r){ if ($r_json) { - echo json_encode(array('error'=>'')); - killme(); - } + echo json_encode(array('error'=>'')); + killme(); + } return false; } $picture = array(); @@ -260,16 +260,16 @@ function wall_upload_post(&$a, $desktopmode = true) { $picture["preview"] = $a->get_baseurl()."/photo/{$hash}-{$smallest}.".$ph->getExt(); if ($r_json) { - echo json_encode(array('picture'=>$picture)); - killme(); - } + echo json_encode(array('picture'=>$picture)); + killme(); + } return $picture; } if ($r_json) { - echo json_encode(array('ok'=>true)); - killme(); - } + echo json_encode(array('ok'=>true)); + killme(); + } /* mod Waitman Gobble NO WARRANTY */