From 55293b4ac33e0f4fd2bfce3a0f5783b42812a65c Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 21 Dec 2022 02:17:29 +0300 Subject: webfinger, app-site-associations: adopt records --- src/main/java/com/juick/www/api/webfinger/Resource.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/main/java/com/juick/www/api/webfinger/Resource.java') diff --git a/src/main/java/com/juick/www/api/webfinger/Resource.java b/src/main/java/com/juick/www/api/webfinger/Resource.java index d3980511..570ceed3 100644 --- a/src/main/java/com/juick/www/api/webfinger/Resource.java +++ b/src/main/java/com/juick/www/api/webfinger/Resource.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2020, Juick + * Copyright (C) 2008-2022, Juick * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -30,7 +30,7 @@ import org.springframework.web.util.UriComponentsBuilder; import rocks.xmpp.addr.Jid; import javax.inject.Inject; -import java.util.Collections; +import java.util.List; import static com.juick.www.api.activity.model.Context.ACTIVITY_MEDIA_TYPE; @@ -52,14 +52,8 @@ public class Resource { if (!user.isAnonymous()) { UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(baseUri); builder.path(String.format("/u/%s", user.getName())); - Link blog = new Link(); - blog.setRel("self"); - blog.setType(ACTIVITY_MEDIA_TYPE); - blog.setHref(builder.toUriString()); - Account result = new Account(); - result.setSubject(resource); - result.setLinks(Collections.singletonList(blog)); - return result; + Link blog = new Link("self", ACTIVITY_MEDIA_TYPE, builder.toUriString()); + return new Account(resource, List.of(blog)); } } } -- cgit v1.2.3