aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/juick/service/MessagesServiceImpl.java23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/main/java/com/juick/service/MessagesServiceImpl.java b/src/main/java/com/juick/service/MessagesServiceImpl.java
index de3429774..ebb8414e2 100644
--- a/src/main/java/com/juick/service/MessagesServiceImpl.java
+++ b/src/main/java/com/juick/service/MessagesServiceImpl.java
@@ -18,7 +18,6 @@
package com.juick.service;
import com.juick.model.*;
-import com.juick.model.User;
import com.juick.www.WebApp;
import com.juick.util.MessageUtils;
import com.juick.util.TagUtils;
@@ -103,16 +102,20 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ
msg.setReplyQuote(MessageUtils.formatQuote(rs.getString(17)));
msg.setUpdated(MessagesServiceImpl.this.getOffsetDateTime(rs, 18).toInstant());
int quoteUid = rs.getInt(19);
- User quoteUser = new User();
- quoteUser.setUid(quoteUid);
- quoteUser.setName(rs.getString(20));
- if (quoteUid == 0) {
- quoteUser.setName(AnonymousUser.INSTANCE.getName());
- quoteUser.setUri(URI.create(Optional.ofNullable(rs.getString(23)).orElse(StringUtils.EMPTY)));
+ if (rs.wasNull()) {
+ msg.setTo(archiveUser);
} else {
- quoteUser.setAvatar(webApp.getAvatarUrl(quoteUser));
+ User quoteUser = new User();
+ quoteUser.setUid(quoteUid);
+ quoteUser.setName(rs.getString(20));
+ if (quoteUid == 0) {
+ quoteUser.setName(AnonymousUser.INSTANCE.getName());
+ quoteUser.setUri(URI.create(Optional.ofNullable(rs.getString(23)).orElse(StringUtils.EMPTY)));
+ } else {
+ quoteUser.setAvatar(webApp.getAvatarUrl(quoteUser));
+ }
+ msg.setTo(quoteUser);
}
- msg.setTo(quoteUser);
msg.setUpdatedAt(MessagesServiceImpl.this.getOffsetDateTime(rs, 21).toInstant());
msg.setReplyUri(URI.create(Optional.ofNullable(rs.getString(24)).orElse(StringUtils.EMPTY)));
msg.setHtml(rs.getBoolean(25));
@@ -897,7 +900,7 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ
+ "replies.user_id, users.nick, users.banned, " + "replies.ts, "
+ "0 as readonly, 0 as privacy, 0 as replies, " + "replies.attach, 0 as likes, 0 as hidden, "
+ "NULL as tags, NULL as repliesby, replies.txt, " + "COALESCE(qw.txt, m.txt) as q, " + ":now, "
- + "COALESCE(qw.user_id, m.user_id) as to_uid, COALESCE(qu.nick, mu.nick) as to_name, "
+ + "qw.user_id as to_uid, qu.nick as to_name, "
+ "replies.updated_at, replies.user_uri as uri, "
+ "qw.user_uri as to_uri, replies.reply_uri, replies.html, 0 as unread, "
+ "0 as subscribed, users.premium "