aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/www/api
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2023-04-26 09:11:53 +0300
committerGravatar Vitaly Takmazov2023-04-26 09:12:11 +0300
commit90201606bb485988f5a85cd578f3f5b8ecddf4db (patch)
tree009e6691d9b32e1cb8605592fcaeed2b8e90977a /src/main/java/com/juick/www/api
parentbd521d4b86f9b3b16caaba714d04e05c2f288847 (diff)
Expose `friendsOnly` message property over API
Diffstat (limited to 'src/main/java/com/juick/www/api')
-rw-r--r--src/main/java/com/juick/www/api/Messages.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/main/java/com/juick/www/api/Messages.java b/src/main/java/com/juick/www/api/Messages.java
index ead2c076..ef55944b 100644
--- a/src/main/java/com/juick/www/api/Messages.java
+++ b/src/main/java/com/juick/www/api/Messages.java
@@ -21,7 +21,6 @@ import com.juick.model.Message;
import com.juick.model.Tag;
import com.juick.model.User;
import com.juick.service.activities.UpdateEvent;
-import com.juick.util.WebUtils;
import com.juick.www.WebApp;
import com.juick.model.CommandResult;
import com.juick.util.HttpBadRequestException;
@@ -43,7 +42,6 @@ import org.springframework.web.bind.annotation.*;
import javax.inject.Inject;
import java.io.IOException;
import java.util.*;
-import java.util.stream.Collectors;
/**
* @author ugnich
@@ -216,7 +214,7 @@ public class Messages {
public void togglePrivacy(@Parameter(hidden = true) User visitor, @RequestParam Integer mid) {
if (visitor.isPremium() || userService.isAdminUser(visitor)) {
var msg = messagesService.getMessage(mid).orElseThrow(HttpNotFoundException::new);
- messagesService.setFriendsOnly(mid, !msg.FriendsOnly);
+ messagesService.setFriendsOnly(mid, !msg.isFriendsOnly());
msg = messagesService.getMessage(mid).orElseThrow(HttpNotFoundException::new);
applicationEventPublisher.publishEvent(
new UpdateEvent(this, visitor, msg));