aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server/api
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-03-12 12:45:17 +0300
committerGravatar Vitaly Takmazov2019-03-12 12:45:17 +0300
commit294805a039dfd38646a47e11acba0d9dbb6c107f (patch)
tree4dd59816af2285078321ad0c1b57fa21af27c100 /src/main/java/com/juick/server/api
parenta7a24ee3cf004f5dafdc1895691dce80a5eaa30d (diff)
add email to nodeinfo metadata
Diffstat (limited to 'src/main/java/com/juick/server/api')
-rw-r--r--src/main/java/com/juick/server/api/xnodeinfo2/Info.java5
-rw-r--r--src/main/java/com/juick/server/api/xnodeinfo2/model/NodeInfo.java13
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 {}
}