diff options
author | Vitaly Takmazov | 2021-10-18 00:40:10 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2021-10-18 02:10:01 +0300 |
commit | a2348e95bbacbc9a9961afcabb7bbe82f3c7fe9d (patch) | |
tree | 7c794eba8ce72e6533a818fcbfb3c8f87e36d2f8 /src/main/java/com/juick/TwitterManager.java | |
parent | 6c82f3dea2c56e8d62bd2f154e2e701f96454418 (diff) |
Display error for social login
* CrossPostService gone
Diffstat (limited to 'src/main/java/com/juick/TwitterManager.java')
-rw-r--r-- | src/main/java/com/juick/TwitterManager.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/juick/TwitterManager.java b/src/main/java/com/juick/TwitterManager.java index 5bb26b7ce..348647086 100644 --- a/src/main/java/com/juick/TwitterManager.java +++ b/src/main/java/com/juick/TwitterManager.java @@ -18,8 +18,8 @@ package com.juick; import com.juick.model.Message; import com.juick.www.api.SystemActivity; +import com.juick.service.UserService; import com.juick.service.component.*; -import com.juick.service.CrosspostService; import com.juick.util.MessageUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -38,7 +38,7 @@ public class TwitterManager implements NotificationListener { private static final Logger logger = LoggerFactory.getLogger(TwitterManager.class); @Inject - private CrosspostService crosspostService; + private UserService userService; @Value("${twitter_consumer_key:12345678}") private String twitter_consumer_key; @@ -46,7 +46,7 @@ public class TwitterManager implements NotificationListener { private String twitter_consumer_secret; void twitterPost(final Message jmsg) { - crosspostService.getTwitterToken(jmsg.getUser().getUid()).ifPresent(t -> { + userService.getTwitterToken(jmsg.getUser().getUid()).ifPresent(t -> { String status = MessageUtils.getMessageHashTags(jmsg) + StringUtils.defaultString(jmsg.getText()); if (status.length() > 253) { status = status.substring(0, 252) + "…"; @@ -75,7 +75,7 @@ public class TwitterManager implements NotificationListener { if (MessageUtils.isPM(msg) || MessageUtils.isReply(msg) || msg.isService()) { return; } - if (StringUtils.isNotEmpty(crosspostService.getTwitterName(msg.getUser().getUid()))) { + if (StringUtils.isNotEmpty(userService.getTwitterName(msg.getUser().getUid()))) { if (msg.getTags().stream().noneMatch(t -> t.getName().equals("notwitter"))) { twitterPost(msg); } |