diff options
author | 2018-10-07 00:13:54 +0300 | |
---|---|---|
committer | 2018-10-07 00:13:54 +0300 | |
commit | 2109acda68cce512b7b2dc80f8243651a213374d (patch) | |
tree | a4cecb03c00308f33fcdbff7c793fde0c0a61608 /juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java | |
parent | e882914b29f384d3f530865737cc7de3790e5b0e (diff) |
Do not duplicate external replies
Diffstat (limited to 'juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java')
-rw-r--r-- | juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java b/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java index 0b0a11ae..4831c9d1 100644 --- a/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java +++ b/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java @@ -1106,4 +1106,10 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ return jdbcTemplate.update("UPDATE replies SET reply_uri=?, html=1 WHERE message_id=? AND reply_id=?", replyUri.toASCIIString(), reply.getMid(), reply.getRid()) > 0; } + + @Override + public boolean replyExists(URI replyUri) { + return jdbcTemplate.queryForList("SELECT reply_id FROM replies WHERE reply_uri=?", + Integer.class, replyUri.toASCIIString()).size() > 0; + } } |