aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/juick/www/api/Mastodon.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/com/juick/www/api/Mastodon.java b/src/main/java/com/juick/www/api/Mastodon.java
index 7591ec92..414c291a 100644
--- a/src/main/java/com/juick/www/api/Mastodon.java
+++ b/src/main/java/com/juick/www/api/Mastodon.java
@@ -83,12 +83,15 @@ public class Mastodon {
String clientSecret) {
}
+ public record AccountSource(String privacy) {}
+
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
public record CredentialAccount(String id, String username, String acct,
String displayName,
Integer followersCount,
Integer followingCount,
- String avatar) {
+ String avatar,
+ AccountSource source) {
}
@@ -215,7 +218,7 @@ public class Mastodon {
}
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
- public record Status(String id, Instant createdAt, String inReplyToId, String inReplyToAccountId,
+ public record Status(String id, Instant createdAt, CredentialAccount account, String inReplyToId, String inReplyToAccountId,
Boolean sensitive, String spoilerText, String visibility, String content) {
}
@@ -236,13 +239,14 @@ public class Mastodon {
user.getFullName(),
userService.getUserReaders(user.getUid()).size(),
userService.getUserFriends(user.getUid()).size(),
- webApp.getAvatarUrl(user));
+ webApp.getAvatarUrl(user), new AccountSource("public"));
}
public Status mapLastMessage(Chat chat) {
return new Status(
String.valueOf(chat.getLastMessageTimestamp().toEpochMilli()),
chat.getLastMessageTimestamp(),
+ toAccount(chat),
null,
null,
false,
@@ -271,6 +275,7 @@ public class Mastodon {
return new Status(
String.valueOf(message.getMid()),
message.getCreated(),
+ toAccount(message.getUser()),
null,
null,
MessageUtils.isSensitive(message),