From 2ab82ad084587a4d143741684088b29f83b0bc8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Sun, 13 May 2018 23:26:30 +0200 Subject: [PATCH] Continued: - used empty() instead of strlen() - PR - added empty lines, removed some MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- ijpost/ijpost.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index de3fd38e..82e9cf93 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -6,6 +6,7 @@ * Author: Tony Baldwin * Author: Michael Johnston * Author: Cat Gray + * @TODO A lot spaces here needs converted to tab */ use Friendica\App; @@ -25,6 +26,7 @@ function ijpost_install() { Addon::registerHook('connector_settings_post', 'addon/ijpost/ijpost.php', 'ijpost_settings_post'); } + function ijpost_uninstall() { Addon::unregisterHook('post_local', 'addon/ijpost/ijpost.php', 'ijpost_post_local'); Addon::unregisterHook('notifier_normal', 'addon/ijpost/ijpost.php', 'ijpost_send'); @@ -34,7 +36,6 @@ function ijpost_uninstall() { } - function ijpost_jot_nets(App $a, &$b) { if(! local_user()) return; @@ -122,7 +123,6 @@ function ijpost_settings_post(App $a, array &$b) { } function ijpost_post_local(App $a, array &$b) { - // This can probably be changed to allow editing by pointing to a different API endpoint if($b['edit']) @@ -173,12 +173,13 @@ function ijpost_send(App $a, array &$b) { intval($b['uid']) ); - if (DBM::is_result($x) && strlen($x[0]['timezone'])) { + if (DBM::is_result($x) && !empty($x[0]['timezone'])) { $tz = $x[0]['timezone']; } $ij_username = PConfig::get($b['uid'],'ijpost','ij_username'); $ij_password = PConfig::get($b['uid'],'ijpost','ij_password'); + $ij_blog = 'http://www.insanejournal.com/interface/xmlrpc'; if ($ij_username && $ij_password && $ij_blog) { @@ -226,6 +227,7 @@ EOT; if($ij_blog !== 'test') { $x = Network::post($ij_blog, $xml, ["Content-Type: text/xml"]); } + logger('posted to insanejournal: ' . ($x) ? $x : '', LOGGER_DEBUG); }