From fdaac8a681b683f35ca1f7fd407bf2f28be6f7b8 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 24 Nov 2019 20:06:47 +0000 Subject: [PATCH] Add "discourse" as protocol --- src/Content/ContactSelector.php | 2 ++ src/Content/Widget.php | 4 ++++ src/Core/Protocol.php | 1 + 3 files changed, 7 insertions(+) diff --git a/src/Content/ContactSelector.php b/src/Content/ContactSelector.php index 478cfdbbe..817602f1e 100644 --- a/src/Content/ContactSelector.php +++ b/src/Content/ContactSelector.php @@ -125,6 +125,7 @@ class ContactSelector Protocol::GPLUS => L10n::t('Google+'), Protocol::PUMPIO => L10n::t('pump.io'), Protocol::TWITTER => L10n::t('Twitter'), + Protocol::DISCOURSE => L10n::t('Discourse'), Protocol::DIASPORA2 => L10n::t('Diaspora Connector'), Protocol::STATUSNET => L10n::t('GNU Social Connector'), Protocol::ACTIVITYPUB => L10n::t('ActivityPub'), @@ -185,6 +186,7 @@ class ContactSelector Protocol::GPLUS => 'google-plus', Protocol::PUMPIO => 'file-text-o', /// @todo Protocol::TWITTER => 'twitter', + Protocol::DISCOURSE => 'dot-circle-o', /// @todo Protocol::DIASPORA2 => 'diaspora', Protocol::STATUSNET => 'gnu-social', Protocol::ACTIVITYPUB => 'activitypub', diff --git a/src/Content/Widget.php b/src/Content/Widget.php index 5878bc75d..b1e925a66 100644 --- a/src/Content/Widget.php +++ b/src/Content/Widget.php @@ -89,6 +89,10 @@ class Widget // Always hide content from these networks $networks = ['face', 'apdn']; + if (!Addon::isEnabled("discourse")) { + $networks[] = Protocol::DISCOURSE; + } + if (!Addon::isEnabled("statusnet")) { $networks[] = Protocol::STATUSNET; } diff --git a/src/Core/Protocol.php b/src/Core/Protocol.php index 0ecc076a0..4157127a4 100644 --- a/src/Core/Protocol.php +++ b/src/Core/Protocol.php @@ -33,6 +33,7 @@ class Protocol const PUMPIO = 'pump'; // pump.io const STATUSNET = 'stac'; // Statusnet connector const TWITTER = 'twit'; // Twitter + const DISCOURSE = 'dscs'; // Discourse // Dead protocols const APPNET = 'apdn'; // app.net - Dead protocol