remove the possibility to receive notifications when subscribing because that sends a lot of notifications, one for each entry in the feed

This commit is contained in:
Athou
2026-02-19 15:53:17 +01:00
parent bcce77495a
commit ba3214bf10
9 changed files with 26 additions and 26 deletions

View File

@@ -77,7 +77,7 @@ public class OPMLImporter {
}
// make sure we continue with the import process even if a feed failed
try {
feedSubscriptionService.subscribe(user, outline.getXmlUrl(), name, parent, position, false);
feedSubscriptionService.subscribe(user, outline.getXmlUrl(), name, parent, position);
} catch (Exception e) {
log.error("error while importing {}: {}", outline.getXmlUrl(), e.getMessage());
}

View File

@@ -49,7 +49,7 @@ public class FeedSubscriptionService {
});
}
public long subscribe(User user, String url, String title, FeedCategory category, int position, boolean pushNotificationsEnabled) {
public long subscribe(User user, String url, String title, FeedCategory category, int position) {
Integer maxFeedsPerUser = config.database().cleanup().maxFeedsPerUser();
if (maxFeedsPerUser > 0 && feedSubscriptionDAO.count(user) >= maxFeedsPerUser) {
String message = String.format("You cannot subscribe to more feeds on this CommaFeed instance (max %s feeds per user)",
@@ -73,7 +73,6 @@ public class FeedSubscriptionService {
sub.setCategory(category);
sub.setPosition(position);
sub.setTitle(FeedUtils.truncate(title, 128));
sub.setPushNotificationsEnabled(pushNotificationsEnabled);
return feedSubscriptionDAO.merge(sub).getId();
}

View File

@@ -27,8 +27,4 @@ public class SubscribeRequest implements Serializable {
@Schema(description = "id of the user category to place the feed in")
@Size(max = 128)
private String categoryId;
@Schema(description = "whether to send push notifications for new entries of this feed")
private boolean pushNotificationsEnabled;
}

View File

@@ -365,8 +365,7 @@ public class FeedREST {
FeedInfo info = fetchFeedInternal(prependHttp(req.getUrl()));
User user = authenticationContext.getCurrentUser();
long subscriptionId = feedSubscriptionService.subscribe(user, info.getUrl(), req.getTitle(), category, 0,
req.isPushNotificationsEnabled());
long subscriptionId = feedSubscriptionService.subscribe(user, info.getUrl(), req.getTitle(), category, 0);
return Response.ok(subscriptionId).build();
} catch (Exception e) {
log.error("Failed to subscribe to URL {}: {}", req.getUrl(), e.getMessage(), e);
@@ -385,7 +384,7 @@ public class FeedREST {
Preconditions.checkNotNull(url);
FeedInfo info = fetchFeedInternal(prependHttp(url));
User user = authenticationContext.getCurrentUser();
feedSubscriptionService.subscribe(user, info.getUrl(), info.getTitle(), null, 0, false);
feedSubscriptionService.subscribe(user, info.getUrl(), info.getTitle(), null, 0);
} catch (Exception e) {
log.info("Could not subscribe to url {} : {}", url, e.getMessage());
}