aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2023-02-03 18:33:15 +0300
committerGravatar Vitaly Takmazov2023-02-03 18:33:15 +0300
commitc425c26088f599b26308b36b5950560763753f5a (patch)
tree6133a9dd6cea2313b67374330c622b8bceebf2c4 /src/main/java/com/juick
parent9352fb9b47ae820eed56bc35dcafdc297932f8f2 (diff)
db: read message text with null coalescing
Diffstat (limited to 'src/main/java/com/juick')
-rw-r--r--src/main/java/com/juick/service/MessagesServiceImpl.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/com/juick/service/MessagesServiceImpl.java b/src/main/java/com/juick/service/MessagesServiceImpl.java
index ccace3a8..55a44bb9 100644
--- a/src/main/java/com/juick/service/MessagesServiceImpl.java
+++ b/src/main/java/com/juick/service/MessagesServiceImpl.java
@@ -423,7 +423,7 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ
public Message getReply(final int mid, final int rid) {
var sql = """
SELECT replies.user_id, users.nick,
- replies.replyto, replies.ts, replies.attach, replies.txt, COALESCE(q.txt,m.txt) as quote,
+ replies.replyto, replies.ts, replies.attach, replies.txt, COALESCE(q.txt,m.txt, '') as quote,
COALESCE(q.user_id, m.user_id) AS to_uid, COALESCE(qu.nick, mu.nick) AS to_name,
replies.updated_at, replies.user_uri as uri,
q.user_uri AS to_uri, replies.reply_uri AS reply_uri, replies.html, q.reply_uri
@@ -807,7 +807,7 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ
messages.hidden,
'' as tags,
messages.repliesby,
- messages.txt, '' as q,
+ COALESCE(messages.txt, '') txt, '' as q,
messages.updated,
0 as to_uid,
NULL as to_name,