From 294805a039dfd38646a47e11acba0d9dbb6c107f Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 12 Mar 2019 12:45:17 +0300 Subject: add email to nodeinfo metadata --- src/main/java/com/juick/server/api/xnodeinfo2/Info.java | 5 +++++ .../com/juick/server/api/xnodeinfo2/model/NodeInfo.java | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'src/main') 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 b71637b91..493bff6a3 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 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 44bd43252..1ebe39a85 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 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 getMetadata() { + return metadata; + } + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + public interface NodeInfoView {} public interface XNodeInfoView {} } -- cgit v1.2.3