From cb37588375c6a765b1d289e26a3e38c730d9a282 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 27 Nov 2019 07:44:59 +0000 Subject: [PATCH] We can always send via SMTP, receiving mails is via IMAP --- src/Module/NodeInfo.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Module/NodeInfo.php b/src/Module/NodeInfo.php index 999b3fb8f2..a4bc9be2b4 100644 --- a/src/Module/NodeInfo.php +++ b/src/Module/NodeInfo.php @@ -89,15 +89,11 @@ class NodeInfo extends BaseModule */ private static function getServices(App $app) { - $config = $app->getConfig(); - $services = [ 'inbound' => [], 'outbound' => [], ]; - $smtp = (function_exists('imap_open') && !$config->get('system', 'imap_disabled') && !$config->get('system', 'dfrn_only')); - if (Addon::isEnabled('blogger')) { $services['outbound'][] = 'blogger'; } @@ -130,9 +126,9 @@ class NodeInfo extends BaseModule $services['inbound'][] = 'pumpio'; $services['outbound'][] = 'pumpio'; } - if ($smtp) { - $services['outbound'][] = 'smtp'; - } + + $services['outbound'][] = 'smtp'; + if (Addon::isEnabled('tumblr')) { $services['outbound'][] = 'tumblr'; } @@ -218,6 +214,8 @@ class NodeInfo extends BaseModule { $config = $app->getConfig(); + $imap = (function_exists('imap_open') && !$config->get('system', 'imap_disabled') && !$config->get('system', 'dfrn_only')); + $nodeinfo = [ 'version' => '2.0', 'software' => [ @@ -253,6 +251,10 @@ class NodeInfo extends BaseModule $nodeinfo['services']['inbound'][] = 'rss2.0'; $nodeinfo['services']['outbound'][] = 'atom1.0'; + if ($imap) { + $nodeinfo['services']['inbound'][] = 'imap'; + } + $nodeinfo['metadata']['explicitContent'] = $config->get('system', 'explicit_content', false) == true; header('Content-type: application/json; charset=utf-8'); -- 2.39.5