aboutsummaryrefslogtreecommitdiff
path: root/juick-server-jdbc/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-03-13 15:18:03 +0300
committerGravatar Vitaly Takmazov2018-03-13 15:18:03 +0300
commitf010d75872763547ecbe621ae3e8eb967950453f (patch)
tree385d3f0a960e10c7fd054fcb71ea280142495d31 /juick-server-jdbc/src
parentcd7e11563721d223b30f9b9edaa8295c2c97c6f7 (diff)
core: cleanup unused message properties
Diffstat (limited to 'juick-server-jdbc/src')
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java8
-rw-r--r--juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java3
2 files changed, 4 insertions, 7 deletions
diff --git a/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java
index fd93a5e1..9c252f1f 100644
--- a/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java
@@ -85,15 +85,11 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ
msg.FriendsOnly = msg.getPrivacy() < 0;
msg.setReplies(rs.getInt(11));
msg.setAttachmentType(rs.getString(12));
- if (rs.getDouble(13) != 0) {
- msg.Place = new com.juick.Place();
- msg.Place.lat = rs.getDouble(14);
- msg.Place.lon = rs.getDouble(15);
- }
+ // TODO: reorder after place deletion
msg.setLikes(rs.getInt(16));
msg.Hidden = rs.getBoolean(17);
String tagsStr = rs.getString(18);
- msg.parseTags(tagsStr);
+ msg.setTags(MessageUtils.parseTags(tagsStr));
msg.setRepliesBy(rs.getString(19));
msg.setText(rs.getString(20));
msg.setReplyQuote(MessageUtils.formatQuote(rs.getString(21)));
diff --git a/juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java b/juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java
index d24a6281..d9f095ac 100644
--- a/juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java
+++ b/juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java
@@ -24,6 +24,7 @@ import com.juick.configuration.DataConfiguration;
import com.juick.configuration.RepositoryConfiguration;
import com.juick.server.helpers.AnonymousUser;
import com.juick.server.helpers.TagStats;
+import com.juick.util.MessageUtils;
import org.apache.commons.lang3.StringUtils;
import org.junit.*;
import org.junit.runner.RunWith;
@@ -190,7 +191,7 @@ public class MessageServiceTest extends AbstractJUnit4SpringContextTests {
assertEquals("db tags should not be escaped", dbTagName, htmlTag.getName());
int mid4 = messagesService.createMessage(user_id, "yoyoyo", null, null);
Message msg4 = messagesService.getMessage(mid4);
- assertEquals("tags string should be empty", StringUtils.EMPTY, msg4.getTagsString());
+ assertEquals("tags string should be empty", StringUtils.EMPTY, MessageUtils.getTagsString(msg4));
messagesService.deleteMessage(user_id, mid4);
}
@Test