From 880535098d71e80944bbc6496cba692d68c342b6 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 20 Aug 2021 12:34:09 +0300 Subject: ActivityPub: fix contexts serialization --- src/main/java/com/juick/www/api/activity/model/Context.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/juick/www/api/activity/model/Context.java b/src/main/java/com/juick/www/api/activity/model/Context.java index 5d945749..a9d61617 100644 --- a/src/main/java/com/juick/www/api/activity/model/Context.java +++ b/src/main/java/com/juick/www/api/activity/model/Context.java @@ -26,8 +26,8 @@ import com.juick.www.api.activity.model.objects.*; import java.time.Instant; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.List; +import java.util.Map; @JsonIgnoreProperties(ignoreUnknown = true) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property="type") @@ -115,8 +115,7 @@ public abstract class Context { public static Context build(Context response) { response.context = new ArrayList<>(Arrays.asList(ACTIVITY_STREAMS_URI, SECURITY_URI)); - response.context.add(Collections.singletonMap("Hashtag", "as:Hashtag")); - response.context.add(Collections.singletonMap("sensitive", "as:sensitive")); + response.context.add(Map.of("Hashtag", "as:Hashtag", "sensitive", "as:sensitive")); return response; } -- cgit v1.2.3