@@ -48,8 +48,9 @@ Q_LOGGING_CATEGORY(lcDb, "nextcloud.sync.database", QtInfoMsg)
48
48
49
49
#define GET_FILE_RECORD_QUERY \
50
50
" SELECT path, inode, modtime, type, md5, fileid, remotePerm, filesize," \
51
- " ignoredChildrenRemote, contentchecksumtype.name || ':' || contentChecksum, e2eMangledName, isE2eEncrypted, " \
52
- " lock, lockOwnerDisplayName, lockOwnerId, lockType, lockOwnerEditor, lockTime, lockTimeout, lockToken, isShared, lastShareStateFetchedTimestmap, sharedByMe, isLivePhoto, livePhotoFile" \
51
+ " ignoredChildrenRemote, contentchecksumtype.name || ':' || contentChecksum, e2eMangledName, isE2eEncrypted, e2eCertificateFingerprint, " \
52
+ " lock, lockOwnerDisplayName, lockOwnerId, lockType, lockOwnerEditor, lockTime, lockTimeout, lockToken, isShared, lastShareStateFetchedTimestmap, " \
53
+ " sharedByMe, isLivePhoto, livePhotoFile" \
53
54
" FROM metadata" \
54
55
" LEFT JOIN checksumtype as contentchecksumtype ON metadata.contentChecksumTypeId == contentchecksumtype.id"
55
56
@@ -67,19 +68,20 @@ static void fillFileRecordFromGetQuery(SyncJournalFileRecord &rec, SqlQuery &que
67
68
rec._checksumHeader = query.baValue (9 );
68
69
rec._e2eMangledName = query.baValue (10 );
69
70
rec._e2eEncryptionStatus = static_cast <SyncJournalFileRecord::EncryptionStatus>(query.intValue (11 ));
70
- rec._lockstate ._locked = query.intValue (12 ) > 0 ;
71
- rec._lockstate ._lockOwnerDisplayName = query.stringValue (13 );
72
- rec._lockstate ._lockOwnerId = query.stringValue (14 );
73
- rec._lockstate ._lockOwnerType = query.int64Value (15 );
74
- rec._lockstate ._lockEditorApp = query.stringValue (16 );
75
- rec._lockstate ._lockTime = query.int64Value (17 );
76
- rec._lockstate ._lockTimeout = query.int64Value (18 );
77
- rec._lockstate ._lockToken = query.stringValue (19 );
78
- rec._isShared = query.intValue (20 ) > 0 ;
79
- rec._lastShareStateFetchedTimestamp = query.int64Value (21 );
80
- rec._sharedByMe = query.intValue (22 ) > 0 ;
81
- rec._isLivePhoto = query.intValue (23 ) > 0 ;
82
- rec._livePhotoFile = query.stringValue (24 );
71
+ rec._e2eCertificateFingerprint = query.baValue (12 );
72
+ rec._lockstate ._locked = query.intValue (13 ) > 0 ;
73
+ rec._lockstate ._lockOwnerDisplayName = query.stringValue (14 );
74
+ rec._lockstate ._lockOwnerId = query.stringValue (15 );
75
+ rec._lockstate ._lockOwnerType = query.int64Value (16 );
76
+ rec._lockstate ._lockEditorApp = query.stringValue (17 );
77
+ rec._lockstate ._lockTime = query.int64Value (18 );
78
+ rec._lockstate ._lockTimeout = query.int64Value (19 );
79
+ rec._lockstate ._lockToken = query.stringValue (20 );
80
+ rec._isShared = query.intValue (21 ) > 0 ;
81
+ rec._lastShareStateFetchedTimestamp = query.int64Value (22 );
82
+ rec._sharedByMe = query.intValue (23 ) > 0 ;
83
+ rec._isLivePhoto = query.intValue (24 ) > 0 ;
84
+ rec._livePhotoFile = query.stringValue (25 );
83
85
}
84
86
85
87
static QByteArray defaultJournalMode (const QString &dbPath)
@@ -783,6 +785,7 @@ bool SyncJournalDb::updateMetadataTableStructure()
783
785
addColumn (QStringLiteral (" contentChecksumTypeId" ), QStringLiteral (" INTEGER" ));
784
786
addColumn (QStringLiteral (" e2eMangledName" ), QStringLiteral (" TEXT" ));
785
787
addColumn (QStringLiteral (" isE2eEncrypted" ), QStringLiteral (" INTEGER" ));
788
+ addColumn (QStringLiteral (" e2eCertificateFingerprint" ), QStringLiteral (" TEXT" ));
786
789
addColumn (QStringLiteral (" isShared" ), QStringLiteral (" INTEGER" ));
787
790
addColumn (QStringLiteral (" lastShareStateFetchedTimestmap" ), QStringLiteral (" INTEGER" ));
788
791
addColumn (QStringLiteral (" sharedByMe" ), QStringLiteral (" INTEGER" ));
@@ -995,9 +998,9 @@ Result<void, QString> SyncJournalDb::setFileRecord(const SyncJournalFileRecord &
995
998
996
999
const auto query = _queryManager.get (PreparedSqlQueryManager::SetFileRecordQuery, QByteArrayLiteral (" INSERT OR REPLACE INTO metadata "
997
1000
" (phash, pathlen, path, inode, uid, gid, mode, modtime, type, md5, fileid, remotePerm, filesize, ignoredChildrenRemote, "
998
- " contentChecksum, contentChecksumTypeId, e2eMangledName, isE2eEncrypted, lock, lockType, lockOwnerDisplayName, lockOwnerId, "
1001
+ " contentChecksum, contentChecksumTypeId, e2eMangledName, isE2eEncrypted, e2eCertificateFingerprint, lock, lockType, lockOwnerDisplayName, lockOwnerId, "
999
1002
" lockOwnerEditor, lockTime, lockTimeout, lockToken, isShared, lastShareStateFetchedTimestmap, sharedByMe, isLivePhoto, livePhotoFile) "
1000
- " VALUES (?1 , ?2, ?3 , ?4 , ?5 , ?6 , ?7, ?8 , ?9 , ?10, ?11, ?12, ?13, ?14, ?15, ?16, ?17, ?18, ?19, ?20, ?21, ?22, ?23, ?24, ?25, ?26, ?27, ?28, ?29, ?30, ?31);" ),
1003
+ " VALUES (?1 , ?2, ?3 , ?4 , ?5 , ?6 , ?7, ?8 , ?9 , ?10, ?11, ?12, ?13, ?14, ?15, ?16, ?17, ?18, ?19, ?20, ?21, ?22, ?23, ?24, ?25, ?26, ?27, ?28, ?29, ?30, ?31, ?32 );" ),
1001
1004
_db);
1002
1005
if (!query) {
1003
1006
qCDebug (lcDb) << " database error:" << query->error ();
@@ -1022,19 +1025,20 @@ Result<void, QString> SyncJournalDb::setFileRecord(const SyncJournalFileRecord &
1022
1025
query->bindValue (16 , contentChecksumTypeId);
1023
1026
query->bindValue (17 , record._e2eMangledName );
1024
1027
query->bindValue (18 , static_cast <int >(record._e2eEncryptionStatus ));
1025
- query->bindValue (19 , record._lockstate ._locked ? 1 : 0 );
1026
- query->bindValue (20 , record._lockstate ._lockOwnerType );
1027
- query->bindValue (21 , record._lockstate ._lockOwnerDisplayName );
1028
- query->bindValue (22 , record._lockstate ._lockOwnerId );
1029
- query->bindValue (23 , record._lockstate ._lockEditorApp );
1030
- query->bindValue (24 , record._lockstate ._lockTime );
1031
- query->bindValue (25 , record._lockstate ._lockTimeout );
1032
- query->bindValue (26 , record._lockstate ._lockToken );
1033
- query->bindValue (27 , record._isShared );
1034
- query->bindValue (28 , record._lastShareStateFetchedTimestamp );
1035
- query->bindValue (29 , record._sharedByMe );
1036
- query->bindValue (30 , record._isLivePhoto );
1037
- query->bindValue (31 , record._livePhotoFile );
1028
+ query->bindValue (19 , record._e2eCertificateFingerprint );
1029
+ query->bindValue (20 , record._lockstate ._locked ? 1 : 0 );
1030
+ query->bindValue (21 , record._lockstate ._lockOwnerType );
1031
+ query->bindValue (22 , record._lockstate ._lockOwnerDisplayName );
1032
+ query->bindValue (23 , record._lockstate ._lockOwnerId );
1033
+ query->bindValue (24 , record._lockstate ._lockEditorApp );
1034
+ query->bindValue (25 , record._lockstate ._lockTime );
1035
+ query->bindValue (26 , record._lockstate ._lockTimeout );
1036
+ query->bindValue (27 , record._lockstate ._lockToken );
1037
+ query->bindValue (28 , record._isShared );
1038
+ query->bindValue (29 , record._lastShareStateFetchedTimestamp );
1039
+ query->bindValue (30 , record._sharedByMe );
1040
+ query->bindValue (31 , record._isLivePhoto );
1041
+ query->bindValue (32 , record._livePhotoFile );
1038
1042
1039
1043
if (!query->exec ()) {
1040
1044
qCDebug (lcDb) << " database error:" << query->error ();
@@ -3035,7 +3039,7 @@ SyncJournalDb::PinStateInterface::rawList()
3035
3039
3036
3040
SyncJournalDb::PinStateInterface SyncJournalDb::internalPinStates ()
3037
3041
{
3038
- return {this };
3042
+ return PinStateInterface {this };
3039
3043
}
3040
3044
3041
3045
void SyncJournalDb::commit (const QString &context, bool startTrans)
0 commit comments