Skip to content

Commit

Permalink
'#1889: Apply project's code formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
wladimirleite committed Sep 21, 2023
1 parent c41132c commit 4aacdbe
Showing 1 changed file with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
*/
public class ExtractorAndroidNew extends Extractor {


public ExtractorAndroidNew(String itemPath, File databaseFile, WAContactsDirectory contacts, WAAccount account) {
super(itemPath, databaseFile, contacts, account, false);
}
Expand Down Expand Up @@ -192,7 +191,7 @@ private void extractCalls(Connection conn, Map<Long, Chat> idToChat) throws SQLE
}
}

private void extractMessages(Connection conn, Map<Long,Chat> idToChat) throws SQLException {
private void extractMessages(Connection conn, Map<Long, Chat> idToChat) throws SQLException {
boolean hasReactionTable = SQLite3DBParser.containsTable("message_add_on_reaction", conn);
try (PreparedStatement stmt = conn.prepareStatement(getSelectMessagesQuery(conn))) {
ResultSet rs = stmt.executeQuery();
Expand Down Expand Up @@ -250,7 +249,7 @@ private void extractMessages(Connection conn, Map<Long,Chat> idToChat) throws SQ
if (hasAddOn) {
extractAddOns(conn, m, hasReactionTable);
}

if (m.getMessageType() == BLOCKED_CONTACT && isUnblocked(conn, m.getId())) {
m.setMessageType(UNBLOCKED_CONTACT);
}
Expand Down Expand Up @@ -418,19 +417,21 @@ protected Message.MessageType decodeMessageType(int messageType, int status, Int
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=?";

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

private static String getSelectMessagesQuery(Connection conn) throws SQLException {
String captionCol = SQLite3DBParser.checkIfColumnExists(conn, "message_media", "media_caption") ? "mm.media_caption" : "null";
String captionCol = SQLite3DBParser.checkIfColumnExists(conn, "message_media", "media_caption")
? "mm.media_caption"
: "null";
return "select m._id AS id,cv._id as chatId, cv.raw_string_jid "
+ " as remoteId, jid.raw_string as remoteResource, status, mv.vcard, m.text_data, "
+ " m.from_me as fromMe, m.timestamp as timestamp, message_url as mediaUrl,"
+ " mm.mime_type as mediaMime, mm.file_length as mediaSize, media_name as mediaName, "
+ " m.message_type as messageType, latitude, longitude, mm.media_duration, "
+ captionCol + " as mediaCaption, mm.file_hash as mediaHash, thumbnail as thumbData,"
+ " m.message_type as messageType, latitude, longitude, mm.media_duration, " + captionCol
+ " as mediaCaption, mm.file_hash as mediaHash, thumbnail as thumbData,"
+ " ms.action_type as actionType, m.message_add_on_flags as hasAddOn,"
+ " (m.origination_flags & 1) as forwarded"
+ " from message m inner join chat_view cv on m.chat_row_id=cv._id"
Expand All @@ -448,9 +449,9 @@ private static String getSelectBlockedQuery(Connection conn) throws SQLException
}
return "select is_blocked as isBlocked from message_system_block_contact where message_row_id=?";
}
private static final String SELECT_CALLS = "select c_l._id as id, c_l.call_id, c_l.video_call, c_l.duration, c_l.timestamp, c_l.call_result, c_l.from_me,"
+ " cv._id as chatId, cv.raw_string_jid as remoteId"

private static final String SELECT_CALLS = "select c_l._id as id, c_l.call_id, c_l.video_call, c_l.duration,"
+ " c_l.timestamp, c_l.call_result, c_l.from_me, cv._id as chatId, cv.raw_string_jid as remoteId"
+ " from call_log c_l inner join chat c on c_l.jid_row_id=c.jid_row_id inner join chat_view cv on cv._id=c._id";

private static final String SELECT_GROUP_MEMBERS = "select g._id as group_id, g.raw_string as group_name, u._id as user_id, u.raw_string as member "
Expand Down

0 comments on commit 4aacdbe

Please sign in to comment.