aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/www/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/www/api')
-rw-r--r--src/main/java/com/juick/www/api/Notifications.java6
-rw-r--r--src/main/java/com/juick/www/api/activity/Profile.java8
2 files changed, 7 insertions, 7 deletions
diff --git a/src/main/java/com/juick/www/api/Notifications.java b/src/main/java/com/juick/www/api/Notifications.java
index 5f941ba5..09dad9e2 100644
--- a/src/main/java/com/juick/www/api/Notifications.java
+++ b/src/main/java/com/juick/www/api/Notifications.java
@@ -76,11 +76,11 @@ public class Notifications {
pushQueriesService.getMPNSURL(uid).forEach(t -> user.getTokens().add(new ExternalToken(null, "mpns", t, null)));
List<ExternalToken> xmppJids = userService.getJIDsbyUID(uid).stream()
.map(jid -> new ExternalToken(null, "xmpp", jid, null))
- .collect(Collectors.toList());
+ .toList();
user.getTokens().addAll(xmppJids);
List<ExternalToken> tgIds = telegramService.getTelegramIdentifiers(Collections.singletonList(user)).stream()
.map(tgId -> new ExternalToken(null, "durov", String.valueOf(tgId), null))
- .collect(Collectors.toList());
+ .toList();
user.getTokens().addAll(tgIds);
return user;
}
@@ -116,7 +116,7 @@ public class Notifications {
}
return users.stream().map(User::getUid)
- .map(this::collectTokens).collect(Collectors.toList());
+ .map(this::collectTokens).toList();
} else {
// read
return Collections.singletonList(collectTokens(uid));
diff --git a/src/main/java/com/juick/www/api/activity/Profile.java b/src/main/java/com/juick/www/api/activity/Profile.java
index c87d6118..fb66400d 100644
--- a/src/main/java/com/juick/www/api/activity/Profile.java
+++ b/src/main/java/com/juick/www/api/activity/Profile.java
@@ -142,7 +142,7 @@ public class Profile {
String personUri = uri.path(String.format("/u/%s", userName)).toUriString();
List<Integer> mids = messagesService.getUserBlog(user.getUid(), 0, before);
List<Note> notes = messagesService.getMessages(visitor, mids).stream().map(activityPubManager::makeNote)
- .collect(Collectors.toList());
+ .toList();
OrderedCollectionPage page = new OrderedCollectionPage();
page.setPartOf(uri.replacePath(String.format("/u/%s/blog/toc", userName)).toUriString());
page.setFirst(uri.replacePath(String.format("/u/%s/blog", userName)).toUriString());
@@ -155,7 +155,7 @@ public class Profile {
create.setObject(a);
create.setPublished(a.getPublished());
return create;
- }).collect(Collectors.toList()));
+ }).toList());
int beforeNext = mids.stream().reduce((fst, second) -> second).orElse(0);
if (beforeNext > 0) {
page.setNext(uri.queryParam("before", beforeNext).toUriString());
@@ -200,7 +200,7 @@ public class Profile {
follower.setPreferredUsername(a.getName());
follower.setUrl(profileUriBuilder.personWebUri(a));
return follower;
- }).collect(Collectors.toList()));
+ }).toList());
boolean hasNext = followers.size() <= 20 * page;
if (hasNext) {
result.setNext(uriComponentsBuilder.queryParam("page", page + 1).toUriString());
@@ -244,7 +244,7 @@ public class Profile {
follower.setPreferredUsername(a.getName());
follower.setUrl(profileUriBuilder.personWebUri(a));
return follower;
- }).collect(Collectors.toList()));
+ }).toList());
boolean hasNext = following.size() <= 20 * page;
if (hasNext) {
result.setNext(uriComponentsBuilder.queryParam("page", page + 1).toUriString());