Skip to content

Commit

Permalink
'#2326: Read CHAT and JID directly instead of CHAT_VIEW that changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
wladimirleite committed Oct 1, 2024
1 parent fe59d54 commit def5901
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ protected List<Chat> extractChatList() throws WAExtractorException {
Map<Long, Chat> idToChat = new HashMap<Long, Chat>();

try (Connection conn = getConnection(); Statement stmt = conn.createStatement()) {
try (ResultSet rs = stmt.executeQuery(SELECT_CHAT_VIEW)) {
try (ResultSet rs = stmt.executeQuery(SELECT_CHATS)) {

while (rs.next()) {
String contactId = rs.getString("contact"); //$NON-NLS-1$
Expand Down Expand Up @@ -946,8 +946,8 @@ protected Message.MessageType decodeMessageType(int messageType, int status, Int
return result;
}

private static final String SELECT_CHAT_VIEW = "SELECT _id as id, raw_string_jid AS contact," //$NON-NLS-1$
+ " subject, created_timestamp as creation, sort_timestamp FROM chat_view ORDER BY sort_timestamp DESC"; //$NON-NLS-1$
private static final String SELECT_CHATS = "SELECT c._id as id, j.raw_string AS contact, c.subject, c.created_timestamp as creation,"
+ " sort_timestamp FROM chat c, jid j WHERE c.jid_row_id = j._id ORDER BY c.sort_timestamp DESC";

private static final String SELECT_ADD_ONS = "SELECT message_add_on_type as type,timestamp, status,jid.raw_string as remoteResource,from_me as fromMe FROM message_add_on m left join jid on jid._id=m.sender_jid_row_id where parent_message_row_id=?";

Expand Down

0 comments on commit def5901

Please sign in to comment.