diff options
author | Vitaly Takmazov | 2024-04-27 19:54:16 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2024-04-27 21:45:00 +0300 |
commit | f2421c1e8ed0a0c8392b179435d638ff55fe1551 (patch) | |
tree | c95ec31b18ec23498408b4c34a351dcfbb4c2cdd /src/main/java/com/juick/service | |
parent | 57fae6b2d4e2f94e49a3b809a47ef4abc2a1ef80 (diff) |
Fix text truncation in reply quotes and Twitter posts
Diffstat (limited to 'src/main/java/com/juick/service')
-rw-r--r-- | src/main/java/com/juick/service/TwitterService.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/com/juick/service/TwitterService.java b/src/main/java/com/juick/service/TwitterService.java index d0c105f2..ffcaca13 100644 --- a/src/main/java/com/juick/service/TwitterService.java +++ b/src/main/java/com/juick/service/TwitterService.java @@ -27,6 +27,7 @@ import com.github.scribejava.core.model.Verb; import com.github.scribejava.core.oauth.OAuth20Service; import com.juick.model.Message; import com.juick.util.MessageUtils; +import com.juick.util.formatters.PlainTextFormatter; import jakarta.annotation.PostConstruct; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -67,7 +68,7 @@ public class TwitterService { 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) + "…"; + status = PlainTextFormatter.truncateText(status, 252) + "…"; } status += " http://juick.com/" + jmsg.getMid(); try { |