Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WhatsApp Android Parser: Read CHAT and JID directly instead of CHAT_VIEW that was changed (#2326) #2327

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading