diff options
Diffstat (limited to 'src/main/java/com/juick/www/api/Service.java')
-rw-r--r-- | src/main/java/com/juick/www/api/Service.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/juick/www/api/Service.java b/src/main/java/com/juick/www/api/Service.java index 3844d003..fc0132b1 100644 --- a/src/main/java/com/juick/www/api/Service.java +++ b/src/main/java/com/juick/www/api/Service.java @@ -75,8 +75,8 @@ public class Service { private CommandsManager commandsManager; @Inject private ApplicationEventPublisher applicationEventPublisher; - @Value("${api_user:juick}") - private String serviceUser; + @Inject + private User serviceUser; @Value("${upload_tmp_dir:#{systemEnvironment['TEMP'] ?: '/tmp'}}") private String tmpDir; @Value("${banned_emails:}") @@ -90,7 +90,7 @@ public class Service { @PostMapping("/api/mail") @ResponseStatus(value = HttpStatus.OK) public void processMail(@Visitor User current, InputStream data) throws Exception { - if (current.getName().equals(serviceUser)) { + if (current.equals(serviceUser)) { MimeMessage msg = new MimeMessage(session, data); String[] returnPaths = msg.getHeader("Return-Path"); if (returnPaths != null) { @@ -197,7 +197,7 @@ public class Service { @PostMapping("/api/mail/unsubscribe") @ResponseStatus(value = HttpStatus.OK) public void processMailUnsubscribe(@Visitor User current, InputStream data) throws Exception { - if (current.getName().equals(serviceUser)) { + if (current.equals(serviceUser)) { MimeMessage msg = new MimeMessage(session, data); String from = msg.getFrom() == null || msg.getFrom().length > 1 ? ((InternetAddress) msg.getSender()).getAddress() |