forked from Archives/Athou_commafeed
prevent subscription to our own feeds
This commit is contained in:
@@ -31,12 +31,21 @@ public class FeedSubscriptionService {
|
||||
|
||||
@Inject
|
||||
FeedSubscriptionDAO feedSubscriptionDAO;
|
||||
|
||||
@Inject FeedRefreshTaskGiver taskGiver;
|
||||
|
||||
@Inject
|
||||
ApplicationSettingsService applicationSettingsService;
|
||||
|
||||
@Inject
|
||||
FeedRefreshTaskGiver taskGiver;
|
||||
|
||||
public Feed subscribe(User user, String url, String title,
|
||||
FeedCategory category) {
|
||||
|
||||
if (url.startsWith(applicationSettingsService.get().getPublicUrl())) {
|
||||
throw new RuntimeException(
|
||||
"Could not subscribe to a feed from this CommaFeed instance");
|
||||
}
|
||||
|
||||
Feed feed = feedService.findOrCreate(url);
|
||||
|
||||
FeedSubscription sub = feedSubscriptionDAO.findByFeed(user, feed);
|
||||
|
||||
Reference in New Issue
Block a user