diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/juick/server/api/xnodeinfo2/Info.java | 5 | ||||
-rw-r--r-- | src/main/java/com/juick/server/api/xnodeinfo2/model/NodeInfo.java | 13 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/main/java/com/juick/server/api/xnodeinfo2/Info.java b/src/main/java/com/juick/server/api/xnodeinfo2/Info.java index b71637b9..493bff6a 100644 --- a/src/main/java/com/juick/server/api/xnodeinfo2/Info.java +++ b/src/main/java/com/juick/server/api/xnodeinfo2/Info.java @@ -17,6 +17,8 @@ import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; import java.util.Arrays; import java.util.Collections; +import java.util.HashMap; +import java.util.Map; @RestController public class Info { @@ -35,6 +37,9 @@ public class Info { server.setVersion("2.x"); nodeInfo.setServer(server); nodeInfo.setProtocols(Arrays.asList("xmpp", "activitypub", "smtp")); + Map<String, String> metadata = new HashMap<>(); + metadata.put("email", "support@juick.com"); + nodeInfo.setMetadata(metadata); ServiceInfo serviceInfo = new ServiceInfo(); serviceInfo.setInbound(Arrays.asList("jabber", "mastodon", "email", "telegram")); serviceInfo.setOutbound(Arrays.asList("jabber", "mastodon", "telegram", "twitter", "email", "rss")); diff --git a/src/main/java/com/juick/server/api/xnodeinfo2/model/NodeInfo.java b/src/main/java/com/juick/server/api/xnodeinfo2/model/NodeInfo.java index 44bd4325..1ebe39a8 100644 --- a/src/main/java/com/juick/server/api/xnodeinfo2/model/NodeInfo.java +++ b/src/main/java/com/juick/server/api/xnodeinfo2/model/NodeInfo.java @@ -1,9 +1,9 @@ package com.juick.server.api.xnodeinfo2.model; -import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; import java.util.List; +import java.util.Map; public class NodeInfo { @@ -15,6 +15,8 @@ public class NodeInfo { private ServiceInfo services; + private Map<String, String> metadata; + @JsonView({XNodeInfoView.class, NodeInfoView.class}) public String getVersion() { return version; @@ -71,6 +73,15 @@ public class NodeInfo { this.usage = usage; } + @JsonView(NodeInfoView.class) + public Map<String, String> getMetadata() { + return metadata; + } + + public void setMetadata(Map<String, String> metadata) { + this.metadata = metadata; + } + public interface NodeInfoView {} public interface XNodeInfoView {} } |