Skip to content

Commit 3a89ecf

Browse files
committed
Add own device creation ts in crypto API
1 parent 8639971 commit 3a89ecf

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

MatrixSDK/Crypto/MXCrypto.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ extern NSString *const MXDeviceListDidUpdateUsersDevicesNotification;
9595
*/
9696
@property (nullable, nonatomic, readonly) NSString *deviceEd25519Key;
9797

98+
99+
/**
100+
* The user device creation in local timestamp, milliseconds since epoch.
101+
*/
102+
@property (nonatomic) UInt64 deviceCreationTs;
103+
98104
/**
99105
The key backup manager.
100106
*/

MatrixSDK/Crypto/MXCrypto.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,6 +1422,12 @@ - (NSString *)olmVersion
14221422
#endif
14231423
}
14241424

1425+
- (uint64_t)deviceCreationTs
1426+
{
1427+
// Device creation timestamp is not support in legacy crypto
1428+
return 0;
1429+
}
1430+
14251431

14261432
#pragma mark - Gossipping
14271433

MatrixSDK/Crypto/MXCryptoV2.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ class MXCryptoV2: NSObject, MXCrypto {
5656
return machine.deviceEd25519Key
5757
}
5858

59+
var deviceCreationTs: UInt64 {
60+
// own device always exists
61+
return machine.device(userId: machine.userId, deviceId: machine.deviceId)!.firstTimeSeenTs
62+
}
63+
5964
let backup: MXKeyBackup?
6065
let keyVerificationManager: MXKeyVerificationManager
6166
let crossSigning: MXCrossSigning

0 commit comments

Comments
 (0)