mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 20:15:21 +00:00
Remove problematic getLastMessage()
This commit is contained in:
parent
b487d5aa64
commit
f70aa9155b
@ -951,7 +951,13 @@ public class ThreadDatabase extends Database {
|
|||||||
readReceiptCount = 0;
|
readReceiptCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageRecord lastMessage = count > 0 ? getLastMessage(threadId) : null;
|
MessageRecord lastMessage = null;
|
||||||
|
|
||||||
|
if (count > 0) {
|
||||||
|
MmsSmsDatabase mmsSmsDatabase = DatabaseComponent.get(context).mmsSmsDatabase();
|
||||||
|
long messageTimestamp = mmsSmsDatabase.getLastMessageTimestamp(threadId);
|
||||||
|
lastMessage = mmsSmsDatabase.getMessageForTimestamp(messageTimestamp);
|
||||||
|
}
|
||||||
|
|
||||||
return new ThreadRecord(body, snippetUri, lastMessage, recipient, date, count,
|
return new ThreadRecord(body, snippetUri, lastMessage, recipient, date, count,
|
||||||
unreadCount, unreadMentionCount, threadId, deliveryReceiptCount, status, type,
|
unreadCount, unreadMentionCount, threadId, deliveryReceiptCount, status, type,
|
||||||
@ -978,10 +984,4 @@ public class ThreadDatabase extends Database {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private MessageRecord getLastMessage(long threadId) {
|
|
||||||
MmsSmsDatabase mmsSmsDatabase = DatabaseComponent.get(context).mmsSmsDatabase();
|
|
||||||
long messageTimestamp = mmsSmsDatabase.getLastMessageTimestamp(threadId);
|
|
||||||
return mmsSmsDatabase.getMessageForTimestamp(messageTimestamp);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user