aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/www/rss/MessagesView.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2023-01-04 03:38:19 +0300
committerGravatar Vitaly Takmazov2023-01-04 05:46:16 +0300
commitc471503ede9aad91193ff6f93966196e6aff15d6 (patch)
tree8c70c8f58b140465be651cd019f26eadd476711f /src/main/java/com/juick/www/rss/MessagesView.java
parent086d9a7625bfc5a386f5b1028d364fb546c2fa9d (diff)
OAuth authentication for Mastodon and ActivityPub C2S
Diffstat (limited to 'src/main/java/com/juick/www/rss/MessagesView.java')
-rw-r--r--src/main/java/com/juick/www/rss/MessagesView.java62
1 files changed, 32 insertions, 30 deletions
diff --git a/src/main/java/com/juick/www/rss/MessagesView.java b/src/main/java/com/juick/www/rss/MessagesView.java
index 71d63754..d6edeb28 100644
--- a/src/main/java/com/juick/www/rss/MessagesView.java
+++ b/src/main/java/com/juick/www/rss/MessagesView.java
@@ -93,37 +93,39 @@ public class MessagesView extends AbstractRssFeedView {
String feedType = (String) model.get("feedType");
if (userObj != null) {
User user = (User) userObj;
- feed.setDescription(String.format("The latest messages by @%s at Juick", user.getName()));
- String title = String.format("%s - Juick", user.getName());
- feed.setTitle(title);
- String link = String.format("https://juick.com/%s/", user.getName());
- feed.setLink(link);
- try {
- Attachment avatar = storageService.getAvatarMetadata(user);
- Image rssImage = new Image();
- rssImage.setUrl(webApp.getAvatarUrl(user));
- rssImage.setTitle(title);
- rssImage.setLink(link);
- rssImage.setHeight(avatar.getHeight());
- rssImage.setWidth(avatar.getWidth());
- feed.setImage(rssImage);
- } catch (IOException e) {
- logger.warn("Feed avatar not found for {}", user.getName());
+ if (!user.isAnonymous()) {
+ feed.setDescription(String.format("The latest messages by @%s at Juick", user.getName()));
+ String title = String.format("%s - Juick", user.getName());
+ feed.setTitle(title);
+ String link = String.format("https://juick.com/%s/", user.getName());
+ feed.setLink(link);
+ try {
+ Attachment avatar = storageService.getAvatarMetadata(user);
+ Image rssImage = new Image();
+ rssImage.setUrl(webApp.getAvatarUrl(user));
+ rssImage.setTitle(title);
+ rssImage.setLink(link);
+ rssImage.setHeight(avatar.getHeight());
+ rssImage.setWidth(avatar.getWidth());
+ feed.setImage(rssImage);
+ } catch (IOException e) {
+ logger.warn("Feed avatar not found for {}", user.getName());
+ }
+
+ String href = String.format("https://rss.juick.com/%s/%s", user.getName(), feedType);
+ AtomLinkModule atomLinkModule = new AtomLinkModuleImpl();
+ Link atomLink = new Link();
+ atomLink.setHref(href);
+ atomLink.setType("application/rss+xml");
+ atomLink.setRel("self");
+ atomLinkModule.setLinks(Collections.singletonList(atomLink));
+
+ feed.getModules().add(atomLinkModule);
+ } else {
+ feed.setDescription("The latest messages at Juick");
+ feed.setLink("https://juick.com/");
+ feed.setTitle("Juick");
}
-
- String href = String.format("https://rss.juick.com/%s/%s", user.getName(), feedType);
- AtomLinkModule atomLinkModule = new AtomLinkModuleImpl();
- Link atomLink = new Link();
- atomLink.setHref(href);
- atomLink.setType("application/rss+xml");
- atomLink.setRel("self");
- atomLinkModule.setLinks(Collections.singletonList(atomLink));
-
- feed.getModules().add(atomLinkModule);
- } else {
- feed.setDescription("The latest messages at Juick");
- feed.setLink("https://juick.com/");
- feed.setTitle("Juick");
}
MediaModule mediaModule = new MediaModuleImpl();