From 5179d2a856172290a1af2a65c2968e3a3122ff8c Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 24 Oct 2018 19:11:20 +0300 Subject: ActivityPub: fix UOE --- juick-server/src/main/java/com/juick/server/ActivityPubManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/juick-server/src/main/java/com/juick/server/ActivityPubManager.java b/juick-server/src/main/java/com/juick/server/ActivityPubManager.java index 1ffd376b..41dd52eb 100644 --- a/juick-server/src/main/java/com/juick/server/ActivityPubManager.java +++ b/juick-server/src/main/java/com/juick/server/ActivityPubManager.java @@ -31,9 +31,11 @@ import java.io.IOException; import java.io.StringWriter; import java.io.Writer; import java.net.URI; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; import java.util.Optional; import java.util.Set; @@ -139,7 +141,9 @@ public class ActivityPubManager implements ActivityListener, NotificationListene if (MessageUtils.isReply(msg) && msg.getTo().getUri().toASCIIString().length() > 0) { String replier = msg.getTo().getUri().toASCIIString(); subscribers.add(replier); - note.getCc().add(replier); + List cc = new ArrayList<>(note.getCc()); + cc.add(replier); + note.setCc(cc); } subscribers.forEach(acct -> { Optional context = signatureManager.getContext(URI.create(acct)); -- cgit v1.2.3