diff --git a/src/main/java/com/commafeed/backend/feeds/FeedRefreshUpdater.java b/src/main/java/com/commafeed/backend/feeds/FeedRefreshUpdater.java index 63e64802..3fe5b3d6 100644 --- a/src/main/java/com/commafeed/backend/feeds/FeedRefreshUpdater.java +++ b/src/main/java/com/commafeed/backend/feeds/FeedRefreshUpdater.java @@ -15,6 +15,7 @@ import com.commafeed.backend.model.Feed; import com.commafeed.backend.model.FeedEntry; import com.commafeed.backend.model.FeedPushInfo; import com.commafeed.backend.pubsubhubbub.SubscriptionHandler; +import com.commafeed.backend.services.ApplicationSettingsService; import com.commafeed.backend.services.FeedUpdateService; @Stateless @@ -32,13 +33,18 @@ public class FeedRefreshUpdater { @Inject FeedDAO feedDAO; + @Inject + ApplicationSettingsService applicationSettingsService; + @Asynchronous public void updateEntries(Feed feed, Collection entries) { if (CollectionUtils.isNotEmpty(entries)) { feedUpdateService.updateEntries(feed, entries); } feedDAO.update(feed); - handlePubSub(feed); + if (applicationSettingsService.get().isPubsubhubbub()) { + handlePubSub(feed); + } } private void handlePubSub(Feed feed) { diff --git a/src/main/java/com/commafeed/backend/model/ApplicationSettings.java b/src/main/java/com/commafeed/backend/model/ApplicationSettings.java index 01f45dff..68fc0b23 100644 --- a/src/main/java/com/commafeed/backend/model/ApplicationSettings.java +++ b/src/main/java/com/commafeed/backend/model/ApplicationSettings.java @@ -15,24 +15,17 @@ import javax.xml.bind.annotation.XmlRootElement; public class ApplicationSettings extends AbstractModel { private String publicUrl; - - /** - * Wether registrations are open - */ private boolean allowRegistrations = false; - private String googleAnalyticsTrackingCode; - private String googleClientId; private String googleClientSecret; private int backgroundThreads = 3; - private String smtpHost; private int smtpPort; private boolean smtpTls; private String smtpUserName; private String smtpPassword; - + private boolean pubsubhubbub; private boolean feedbackButton = true; @Column(length = 255) @@ -143,4 +136,12 @@ public class ApplicationSettings extends AbstractModel { this.feedbackButton = feedbackButton; } + public boolean isPubsubhubbub() { + return pubsubhubbub; + } + + public void setPubsubhubbub(boolean pubsubhubbub) { + this.pubsubhubbub = pubsubhubbub; + } + } diff --git a/src/main/webapp/templates/admin.settings.html b/src/main/webapp/templates/admin.settings.html index ef26fc53..22bcc325 100644 --- a/src/main/webapp/templates/admin.settings.html +++ b/src/main/webapp/templates/admin.settings.html @@ -111,6 +111,12 @@ ng-model="settings.smtpPassword" /> +
+ +
+ +
+