Skip to content

Commit 89d9701

Browse files
authored
Merge pull request #2764 from sepinf-inc/#2687_WhatsApp_iOS_Forwarded
Minor fix in the check for WhatsApp iOS forwarded messages (#2687)
2 parents 469be94 + ffa2124 commit 89d9701

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/ExtractorIOS.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,8 @@ private Message createMessageFromDB(ResultSet rs, Chat chat) throws SQLException
737737
if (receiptInfo != null) {
738738
decodeReceiptInfo(m, receiptInfo);
739739
}
740-
m.setForwarded(rs.getInt("forwarded") > 0);
740+
int forwardedMask = 0b1_1000_0000; // 8th and 9th bits
741+
m.setForwarded((rs.getLong("zflags") & forwardedMask) == forwardedMask);
741742

742743
byte[] metadata = rs.getBytes("metadata");
743744
if (hasZSTANZAIDAndZMETADATAColumns) {
@@ -1815,7 +1816,7 @@ public void extractPushNames() {
18151816
+ "as mediaName, ZVCARDNAME as mediaHash, ZTITLE as mediaCaption, " //$NON-NLS-1$
18161817
+ "ZLATITUDE as latitude, ZLONGITUDE as longitude, ZMEDIAURL as url, ZXMPPTHUMBPATH as thumbpath, " //$NON-NLS-1$
18171818
+ "INFO.ZRECEIPTINFO as receiptInfo, " //$NON-NLS-1$
1818-
+ "(1 << 7 & ZFLAGS) as forwarded, " //$NON-NLS-1$
1819+
+ "ZFLAGS as zflags, " //$NON-NLS-1$
18191820
+ "ZWAMESSAGE.ZSTANZAID as uuid, ZWAMEDIAITEM.ZMETADATA as metadata, " //$NON-NLS-1$
18201821
+ "ZWAMEDIAITEM.ZMOVIEDURATION as duration, "
18211822
+ "ZGROUPEVENTTYPE as gEventType, ZMESSAGETYPE as messageType, ZSORT FROM ZWAMESSAGE " //$NON-NLS-1$
@@ -1830,7 +1831,7 @@ public void extractPushNames() {
18301831
+ "as mediaName, ZVCARDNAME as mediaHash, ZTITLE as mediaCaption, " //$NON-NLS-1$
18311832
+ "ZLATITUDE as latitude, ZLONGITUDE as longitude, ZMEDIAURL as url, ZXMPPTHUMBPATH as thumbpath, " //$NON-NLS-1$
18321833
+ "INFO.ZRECEIPTINFO as receiptInfo, " //$NON-NLS-1$
1833-
+ "(1 << 7 & ZFLAGS) as forwarded, " //$NON-NLS-1$
1834+
+ "ZFLAGS as zflags, " //$NON-NLS-1$
18341835
+ "ZWAMESSAGE.ZSTANZAID as uuid, ZWAMEDIAITEM.ZMETADATA as metadata, " //$NON-NLS-1$
18351836
+ "ZWAMEDIAITEM.ZMOVIEDURATION as duration, "
18361837
+ "ZGROUPEVENTTYPE as gEventType, ZMESSAGETYPE as messageType, ZSORT FROM ZWAMESSAGE " //$NON-NLS-1$
@@ -1846,7 +1847,7 @@ public void extractPushNames() {
18461847
+ "as mediaName, ZVCARDNAME as mediaHash, NULL as mediaCaption, " //$NON-NLS-1$
18471848
+ "ZLATITUDE as latitude, ZLONGITUDE as longitude, ZMEDIAURL as url, ZXMPPTHUMBPATH as thumbpath, " //$NON-NLS-1$
18481849
+ "INFO.ZRECEIPTINFO as receiptInfo, " //$NON-NLS-1$
1849-
+ "(1 << 7 & ZFLAGS) as forwarded, " //$NON-NLS-1$
1850+
+ "ZFLAGS as zflags, " //$NON-NLS-1$
18501851
+ "ZWAMESSAGE.ZSTANZAID as uuid, ZWAMEDIAITEM.ZMETADATA as metadata, " //$NON-NLS-1$
18511852
+ "ZWAMEDIAITEM.ZMOVIEDURATION as duration, "
18521853
+ "ZGROUPEVENTTYPE as gEventType, ZMESSAGETYPE as messageType, ZSORT FROM ZWAMESSAGE " //$NON-NLS-1$
@@ -1861,7 +1862,7 @@ public void extractPushNames() {
18611862
+ "as mediaName, ZVCARDNAME as mediaHash, NULL as mediaCaption, " //$NON-NLS-1$
18621863
+ "ZLATITUDE as latitude, ZLONGITUDE as longitude, ZMEDIAURL as url, ZXMPPTHUMBPATH as thumbpath, " //$NON-NLS-1$
18631864
+ "INFO.ZRECEIPTINFO as receiptInfo, " //$NON-NLS-1$
1864-
+ "(1 << 7 & ZFLAGS) as forwarded, " //$NON-NLS-1$
1865+
+ "ZFLAGS as zflags, " //$NON-NLS-1$
18651866
+ "ZWAMESSAGE.ZSTANZAID as uuid, ZWAMEDIAITEM.ZMETADATA as metadata, " //$NON-NLS-1$
18661867
+ "ZWAMEDIAITEM.ZMOVIEDURATION as duration, "
18671868
+ "ZGROUPEVENTTYPE as gEventType, ZMESSAGETYPE as messageType, ZSORT FROM ZWAMESSAGE " //$NON-NLS-1$

0 commit comments

Comments
 (0)