diff options
author | Vitaly Takmazov | 2023-01-09 09:45:12 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-09 09:45:12 +0300 |
commit | f6b78c029a1e9e4f09b600131e99bbc13c65f30a (patch) | |
tree | 33511c92dd418d1eced2b4755fc16a583c135d06 /src/main/java/com/juick/www/api/activity/helpers | |
parent | 6b08c391d27a682ffece9e9c471986160e2f94af (diff) |
Mastodon API: statuses
Diffstat (limited to 'src/main/java/com/juick/www/api/activity/helpers')
-rw-r--r-- | src/main/java/com/juick/www/api/activity/helpers/ProfileUriBuilder.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/com/juick/www/api/activity/helpers/ProfileUriBuilder.java b/src/main/java/com/juick/www/api/activity/helpers/ProfileUriBuilder.java index e10c3078..3f48502b 100644 --- a/src/main/java/com/juick/www/api/activity/helpers/ProfileUriBuilder.java +++ b/src/main/java/com/juick/www/api/activity/helpers/ProfileUriBuilder.java @@ -61,9 +61,16 @@ public record ProfileUriBuilder(String baseUri) { return messageUri(msg.getMid(), msg.getRid()); } + public static String messageId(Message msg) { + return messageId(msg.getMid(), msg.getRid()); + } + public static String messageId(int mid, int rid) { + return String.format("%d-%d", mid, rid); + } + public String messageUri(int mid, int rid) { UriComponentsBuilder uri = UriComponentsBuilder.fromUriString(baseUri); - uri.replacePath(String.format("/n/%d-%d", mid, rid)); + uri.replacePath("/n/" + messageId(mid, rid)); return uri.toUriString(); } |