Revert "Auto link broken threads"

This reverts commit 8af8641089.
pull/178/head
M66B 5 years ago
parent aef8b1385e
commit 64b9227ea8

@ -587,9 +587,6 @@ public interface DaoMessage {
@Query("UPDATE message SET revisions = :revisions WHERE id = :id")
int setMessageRevisions(long id, Integer revisions);
@Query("UPDATE message SET thread = :thread WHERE id = :id")
int setMessageThread(long id, String thread);
@Query("UPDATE message" +
" SET content = 0, fts = 0, language = NULL, plain_only = NULL, preview = NULL" +
" WHERE id = :id")

@ -873,19 +873,12 @@ public class MessageHelper {
if (!TextUtils.isEmpty(inreplyto) && !refs.contains(inreplyto))
refs.add(inreplyto);
String thread = null;
DB db = DB.getInstance(context);
for (String ref : refs) {
List<EntityMessage> messages = db.message().getMessagesByMsgId(account, ref);
for (EntityMessage message : messages) {
if (thread == null)
thread = message.thread;
if (thread != null && !thread.equals(message.thread))
db.message().setMessageThread(message.id, thread);
}
if (messages.size() > 0)
return messages.get(0).thread;
}
if (thread != null)
return thread;
if (refs.size() > 0)
return refs.get(0);

Loading…
Cancel
Save