diff options
Diffstat (limited to 'juick-www/src/main/java/com/juick/www/controllers')
-rw-r--r-- | juick-www/src/main/java/com/juick/www/controllers/Settings.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/juick-www/src/main/java/com/juick/www/controllers/Settings.java b/juick-www/src/main/java/com/juick/www/controllers/Settings.java index db60acba6..64775aec1 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/Settings.java +++ b/juick-www/src/main/java/com/juick/www/controllers/Settings.java @@ -16,19 +16,16 @@ */ package com.juick.www.controllers; +import com.juick.server.component.UserUpdatedEvent; import com.juick.server.helpers.NotifyOpts; import com.juick.server.helpers.UserInfo; -import com.juick.server.util.HashUtils; +import com.juick.server.util.*; import com.juick.service.*; -import com.juick.server.util.HttpBadRequestException; -import com.juick.server.util.HttpUtils; -import com.juick.server.util.ImageUtils; -import com.juick.server.util.UserUtils; -import com.juick.www.WebApp; 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.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.GetMapping; @@ -77,6 +74,8 @@ public class Settings { private EmailService emailService; @Inject private TelegramService telegramService; + @Inject + private ApplicationEventPublisher applicationEventPublisher; @GetMapping("/settings") protected String doGet(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws IOException { @@ -164,6 +163,7 @@ public class Settings { ImageUtils.saveAvatar(avatarTmpPath, visitor.getUid(), tmpDir, imgDir); } if (userService.updateUserInfo(visitor, info)) { + applicationEventPublisher.publishEvent(new UserUpdatedEvent(this, visitor)); result = String.format("<p>Your info is updated.</p><p><a href='/%s/'>Back to blog</a>.</p>", visitor.getName()); } break; |