aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-11-03 13:21:51 +0300
committerGravatar Vitaly Takmazov2018-11-03 13:21:51 +0300
commitd03453654ebfe70c5e9d8f27106da2c2c8821a5c (patch)
treee15df7412498b717ceb355104c7ec1e408085902 /juick-server/src/main/java/com/juick/server
parent2a64e080a395170875d62d3bebaf4dce3815bb13 (diff)
Fix modification of immutable list
Diffstat (limited to 'juick-server/src/main/java/com/juick/server')
-rw-r--r--juick-server/src/main/java/com/juick/server/ActivityPubManager.java17
1 files changed, 8 insertions, 9 deletions
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 6f5163cc..4601f7d1 100644
--- a/juick-server/src/main/java/com/juick/server/ActivityPubManager.java
+++ b/juick-server/src/main/java/com/juick/server/ActivityPubManager.java
@@ -4,11 +4,15 @@ import com.juick.Message;
import com.juick.User;
import com.juick.formatters.PlainTextFormatter;
import com.juick.server.api.activity.model.Context;
-import com.juick.server.api.activity.model.objects.*;
import com.juick.server.api.activity.model.activities.Accept;
import com.juick.server.api.activity.model.activities.Announce;
import com.juick.server.api.activity.model.activities.Create;
import com.juick.server.api.activity.model.activities.Delete;
+import com.juick.server.api.activity.model.objects.Hashtag;
+import com.juick.server.api.activity.model.objects.Image;
+import com.juick.server.api.activity.model.objects.Mention;
+import com.juick.server.api.activity.model.objects.Note;
+import com.juick.server.api.activity.model.objects.Person;
import com.juick.server.util.HttpUtils;
import com.juick.service.SocialService;
import com.juick.service.UserService;
@@ -17,17 +21,11 @@ import com.juick.service.component.*;
import com.juick.util.MessageUtils;
import com.mitchellbosecke.pebble.PebbleEngine;
import com.mitchellbosecke.pebble.template.PebbleTemplate;
-import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.ApplicationEventPublisher;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.client.ClientHttpResponse;
import org.springframework.stereotype.Component;
-import org.springframework.web.client.DefaultResponseErrorHandler;
import org.springframework.web.util.UriComponentsBuilder;
import javax.annotation.Nonnull;
@@ -37,7 +35,6 @@ import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
import java.net.URI;
-import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -268,7 +265,9 @@ public class ActivityPubManager implements ActivityListener, NotificationListene
if (personContext.isPresent()) {
Person person = (Person) personContext.get();
note.getTags().add(new Mention(person.getUrl(), person.getPreferredUsername()));
- note.getCc().add(person.getUrl());
+ List<String> cc = new ArrayList<>(note.getCc());
+ cc.add(person.getUrl());
+ note.setCc(cc);
}
});
if (msg.isHtml()) {