mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 02:15:35 +03:00
Remove non needed extra spaces
This commit is contained in:
parent
5b185152c6
commit
f5d0663b06
61 changed files with 248 additions and 248 deletions
|
@ -96,7 +96,7 @@ class CommonTestHelper(context: Context) {
|
|||
/**
|
||||
* This methods init the event stream and check for initial sync
|
||||
*
|
||||
* @param session the session to sync
|
||||
* @param session the session to sync
|
||||
*/
|
||||
fun syncSession(session: Session, timeout: Long = TestConstants.timeOutMillis * 10) {
|
||||
val lock = CountDownLatch(1)
|
||||
|
@ -119,7 +119,7 @@ class CommonTestHelper(context: Context) {
|
|||
/**
|
||||
* This methods clear the cache and waits for initialSync
|
||||
*
|
||||
* @param session the session to sync
|
||||
* @param session the session to sync
|
||||
*/
|
||||
fun clearCacheAndSync(session: Session, timeout: Long = TestConstants.timeOutMillis) {
|
||||
waitWithLatch(timeout) { latch ->
|
||||
|
@ -142,8 +142,8 @@ class CommonTestHelper(context: Context) {
|
|||
/**
|
||||
* Sends text messages in a room
|
||||
*
|
||||
* @param room the room where to send the messages
|
||||
* @param message the message to send
|
||||
* @param room the room where to send the messages
|
||||
* @param message the message to send
|
||||
* @param nbOfMessages the number of time the message will be sent
|
||||
*/
|
||||
fun sendTextMessage(room: Room, message: String, nbOfMessages: Int, timeout: Long = TestConstants.timeOutMillis): List<TimelineEvent> {
|
||||
|
@ -207,8 +207,8 @@ class CommonTestHelper(context: Context) {
|
|||
|
||||
/**
|
||||
* Reply in a thread
|
||||
* @param room the room where to send the messages
|
||||
* @param message the message to send
|
||||
* @param room the room where to send the messages
|
||||
* @param message the message to send
|
||||
* @param numberOfMessages the number of time the message will be sent
|
||||
*/
|
||||
fun replyInThreadMessage(
|
||||
|
@ -232,8 +232,8 @@ class CommonTestHelper(context: Context) {
|
|||
* Creates a unique account
|
||||
*
|
||||
* @param userNamePrefix the user name prefix
|
||||
* @param password the password
|
||||
* @param testParams test params about the session
|
||||
* @param password the password
|
||||
* @param testParams test params about the session
|
||||
* @return the session associated with the newly created account
|
||||
*/
|
||||
private fun createAccount(userNamePrefix: String,
|
||||
|
@ -251,8 +251,8 @@ class CommonTestHelper(context: Context) {
|
|||
/**
|
||||
* Logs into an existing account
|
||||
*
|
||||
* @param userId the userId to log in
|
||||
* @param password the password to log in
|
||||
* @param userId the userId to log in
|
||||
* @param password the password to log in
|
||||
* @param testParams test params about the session
|
||||
* @return the session associated with the existing account
|
||||
*/
|
||||
|
@ -267,8 +267,8 @@ class CommonTestHelper(context: Context) {
|
|||
/**
|
||||
* Create an account and a dedicated session
|
||||
*
|
||||
* @param userName the account username
|
||||
* @param password the password
|
||||
* @param userName the account username
|
||||
* @param password the password
|
||||
* @param sessionTestParams parameters for the test
|
||||
*/
|
||||
private fun createAccountAndSync(userName: String,
|
||||
|
@ -305,8 +305,8 @@ class CommonTestHelper(context: Context) {
|
|||
/**
|
||||
* Start an account login
|
||||
*
|
||||
* @param userName the account username
|
||||
* @param password the password
|
||||
* @param userName the account username
|
||||
* @param password the password
|
||||
* @param sessionTestParams session test params
|
||||
*/
|
||||
private fun logAccountAndSync(userName: String,
|
||||
|
|
|
@ -195,7 +195,7 @@ data class HomeServerConnectionConfig(
|
|||
* - https://www.ssi.gouv.fr/uploads/2017/07/anssi-guide-recommandations_de_securite_relatives_a_tls-v1.2.pdf
|
||||
* - https://developer.android.com/reference/javax/net/ssl/SSLEngine
|
||||
*
|
||||
* @param tlsLimitations true to use Tls limitations
|
||||
* @param tlsLimitations true to use Tls limitations
|
||||
* @param enableCompatibilityMode set to true for Android < 20
|
||||
* @return this builder
|
||||
*/
|
||||
|
|
|
@ -36,7 +36,7 @@ interface ContentUrlResolver {
|
|||
/**
|
||||
* Get the actual URL for accessing the full-size image of a Matrix media content URI.
|
||||
*
|
||||
* @param contentUrl the Matrix media content URI (in the form of "mxc://...").
|
||||
* @param contentUrl the Matrix media content URI (in the form of "mxc://...").
|
||||
* @return the URL to access the described resource, or null if the url is invalid.
|
||||
*/
|
||||
fun resolveFullSize(contentUrl: String?): String?
|
||||
|
@ -44,7 +44,7 @@ interface ContentUrlResolver {
|
|||
/**
|
||||
* Get the ResolvedMethod to download a URL.
|
||||
*
|
||||
* @param contentUrl the Matrix media content URI (in the form of "mxc://...").
|
||||
* @param contentUrl the Matrix media content URI (in the form of "mxc://...").
|
||||
* @param elementToDecrypt Encryption data may be required if you use a content scanner
|
||||
* @return the Method to access resource, or null if invalid
|
||||
*/
|
||||
|
@ -54,9 +54,9 @@ interface ContentUrlResolver {
|
|||
* Get the actual URL for accessing the thumbnail image of a given Matrix media content URI.
|
||||
*
|
||||
* @param contentUrl the Matrix media content URI (in the form of "mxc://...").
|
||||
* @param width the desired width
|
||||
* @param height the desired height
|
||||
* @param method the desired method (METHOD_CROP or METHOD_SCALE)
|
||||
* @param width the desired width
|
||||
* @param height the desired height
|
||||
* @param method the desired method (METHOD_CROP or METHOD_SCALE)
|
||||
* @return the URL to access the described resource, or null if the url is invalid.
|
||||
*/
|
||||
fun resolveThumbnail(contentUrl: String?, width: Int, height: Int, method: ThumbnailMethod): String?
|
||||
|
|
|
@ -34,7 +34,7 @@ interface KeysBackupService {
|
|||
* Create a new keys backup version and enable it, using the information return from [prepareKeysBackupVersion].
|
||||
*
|
||||
* @param keysBackupCreationInfo the info object from [prepareKeysBackupVersion].
|
||||
* @param callback Asynchronous callback
|
||||
* @param callback Asynchronous callback
|
||||
*/
|
||||
fun createKeysBackupVersion(keysBackupCreationInfo: MegolmBackupCreationInfo,
|
||||
callback: MatrixCallback<KeysVersion>)
|
||||
|
@ -122,7 +122,7 @@ interface KeysBackupService {
|
|||
* Delete a keys backup version. It will delete all backed up keys on the server, and the backup itself.
|
||||
* If we are backing up to this version. Backup will be stopped.
|
||||
*
|
||||
* @param version the backup version to delete.
|
||||
* @param version the backup version to delete.
|
||||
* @param callback Asynchronous callback
|
||||
*/
|
||||
fun deleteBackup(version: String,
|
||||
|
@ -173,12 +173,12 @@ interface KeysBackupService {
|
|||
/**
|
||||
* Restore a backup with a recovery key from a given backup version stored on the homeserver.
|
||||
*
|
||||
* @param keysVersionResult the backup version to restore from.
|
||||
* @param recoveryKey the recovery key to decrypt the retrieved backup.
|
||||
* @param roomId the id of the room to get backup data from.
|
||||
* @param sessionId the id of the session to restore.
|
||||
* @param keysVersionResult the backup version to restore from.
|
||||
* @param recoveryKey the recovery key to decrypt the retrieved backup.
|
||||
* @param roomId the id of the room to get backup data from.
|
||||
* @param sessionId the id of the session to restore.
|
||||
* @param stepProgressListener the step progress listener
|
||||
* @param callback Callback. It provides the number of found keys and the number of successfully imported keys.
|
||||
* @param callback Callback. It provides the number of found keys and the number of successfully imported keys.
|
||||
*/
|
||||
fun restoreKeysWithRecoveryKey(keysVersionResult: KeysVersionResult,
|
||||
recoveryKey: String, roomId: String?,
|
||||
|
|
|
@ -46,7 +46,7 @@ class MXUsersDevicesMap<E> {
|
|||
/**
|
||||
* Provides the object for a device id and a user Id.
|
||||
*
|
||||
* @param userId the user id
|
||||
* @param userId the user id
|
||||
* @param deviceId the device id
|
||||
* @return the object
|
||||
*/
|
||||
|
@ -59,9 +59,9 @@ class MXUsersDevicesMap<E> {
|
|||
/**
|
||||
* Set an object for a dedicated user Id and device Id.
|
||||
*
|
||||
* @param userId the user Id
|
||||
* @param userId the user Id
|
||||
* @param deviceId the device id
|
||||
* @param o the object to set
|
||||
* @param o the object to set
|
||||
*/
|
||||
fun setObject(userId: String?, deviceId: String?, o: E?) {
|
||||
if (null != o && userId?.isNotBlank() == true && deviceId?.isNotBlank() == true) {
|
||||
|
@ -73,7 +73,7 @@ class MXUsersDevicesMap<E> {
|
|||
/**
|
||||
* Defines the objects map for a user Id.
|
||||
*
|
||||
* @param userId the user id
|
||||
* @param userId the user id
|
||||
* @param objectsPerDevices the objects maps
|
||||
*/
|
||||
fun setObjects(userId: String?, objectsPerDevices: Map<String, E>?) {
|
||||
|
|
|
@ -71,7 +71,7 @@ interface PermalinkService {
|
|||
* Creates a permalink for an event. If you have an event you can use [createPermalink]
|
||||
* Ex: "https://matrix.to/#/!nbzmcXAqpxBXjAdgoX:matrix.org/$1531497316352799BevdV:matrix.org?via=matrix.org"
|
||||
*
|
||||
* @param roomId the id of the room
|
||||
* @param roomId the id of the room
|
||||
* @param eventId the id of the event
|
||||
* @param forceMatrixTo whether we should force using matrix.to base URL
|
||||
*
|
||||
|
|
|
@ -47,12 +47,12 @@ interface PushersService {
|
|||
* Add a new Email pusher.
|
||||
* Ref: https://matrix.org/docs/spec/client_server/latest#post-matrix-client-r0-pushers-set
|
||||
*
|
||||
* @param email The email address to send notifications to.
|
||||
* @param lang The preferred language for receiving notifications (e.g. "en" or "en-US").
|
||||
* @param emailBranding The branding placeholder to include in the email communications.
|
||||
* @param appDisplayName A human readable string that will allow the user to identify what application owns this pusher.
|
||||
* @param email The email address to send notifications to.
|
||||
* @param lang The preferred language for receiving notifications (e.g. "en" or "en-US").
|
||||
* @param emailBranding The branding placeholder to include in the email communications.
|
||||
* @param appDisplayName A human readable string that will allow the user to identify what application owns this pusher.
|
||||
* @param deviceDisplayName A human readable string that will allow the user to identify what device owns this pusher.
|
||||
* @param append If true, the homeserver should add another pusher with the given pushkey and App ID in addition
|
||||
* @param append If true, the homeserver should add another pusher with the given pushkey and App ID in addition
|
||||
* to any others with different user IDs. Otherwise, the homeserver must remove any other pushers
|
||||
* with the same App ID and pushkey for different users. Typically We always want to append for
|
||||
* email pushers since we don't want to stop other accounts notifying to the same email address.
|
||||
|
|
|
@ -67,7 +67,7 @@ data class RuleSet(
|
|||
/**
|
||||
* Find a rule from its rule Id.
|
||||
*
|
||||
* @param rules the rules list.
|
||||
* @param rules the rules list.
|
||||
* @param ruleId the rule Id.
|
||||
* @return the bing rule if it exists, else null.
|
||||
*/
|
||||
|
|
|
@ -58,7 +58,7 @@ class PowerLevelsHelper(private val powerLevelsContent: PowerLevelsContent) {
|
|||
/**
|
||||
* Tell if an user can send an event of a certain type.
|
||||
*
|
||||
* @param userId the id of the user to check for.
|
||||
* @param userId the id of the user to check for.
|
||||
* @param isState true if the event is a state event (ie. state key is not null)
|
||||
* @param eventType the event type to check for
|
||||
* @return true if the user can send this type of event
|
||||
|
|
|
@ -49,7 +49,7 @@ interface WidgetPostAPIMediator {
|
|||
/**
|
||||
* Send a boolean response.
|
||||
*
|
||||
* @param response the response
|
||||
* @param response the response
|
||||
* @param eventData the modular data
|
||||
*/
|
||||
fun sendBoolResponse(response: Boolean, eventData: JsonDict)
|
||||
|
@ -57,7 +57,7 @@ interface WidgetPostAPIMediator {
|
|||
/**
|
||||
* Send an integer response.
|
||||
*
|
||||
* @param response the response
|
||||
* @param response the response
|
||||
* @param eventData the modular data
|
||||
*/
|
||||
fun sendIntegerResponse(response: Int, eventData: JsonDict)
|
||||
|
@ -67,7 +67,7 @@ interface WidgetPostAPIMediator {
|
|||
*
|
||||
* @param T the generic type
|
||||
* @param type the type of the response
|
||||
* @param response the response
|
||||
* @param response the response
|
||||
* @param eventData the modular data
|
||||
*/
|
||||
fun <T> sendObjectResponse(type: Type, response: T?, eventData: JsonDict)
|
||||
|
@ -82,7 +82,7 @@ interface WidgetPostAPIMediator {
|
|||
/**
|
||||
* Send an error.
|
||||
*
|
||||
* @param message the error message
|
||||
* @param message the error message
|
||||
* @param eventData the modular data
|
||||
*/
|
||||
fun sendError(message: String, eventData: JsonDict)
|
||||
|
|
|
@ -508,7 +508,7 @@ internal class DefaultCryptoService @Inject constructor(
|
|||
/**
|
||||
* Provides the device information for a user id and a device Id.
|
||||
*
|
||||
* @param userId the user id
|
||||
* @param userId the user id
|
||||
* @param deviceId the device id
|
||||
*/
|
||||
override fun getDeviceInfo(userId: String, deviceId: String?): CryptoDeviceInfo? {
|
||||
|
@ -538,7 +538,7 @@ internal class DefaultCryptoService @Inject constructor(
|
|||
/**
|
||||
* Set the devices as known.
|
||||
*
|
||||
* @param devices the devices. Note that the verified member of the devices in this list will not be updated by this method.
|
||||
* @param devices the devices. Note that the verified member of the devices in this list will not be updated by this method.
|
||||
* @param callback the asynchronous callback
|
||||
*/
|
||||
override fun setDevicesKnown(devices: List<MXDeviceInfo>, callback: MatrixCallback<Unit>?) {
|
||||
|
@ -576,8 +576,8 @@ internal class DefaultCryptoService @Inject constructor(
|
|||
* Update the blocked/verified state of the given device.
|
||||
*
|
||||
* @param trustLevel the new trust level
|
||||
* @param userId the owner of the device
|
||||
* @param deviceId the unique identifier for the device.
|
||||
* @param userId the owner of the device
|
||||
* @param deviceId the unique identifier for the device.
|
||||
*/
|
||||
override fun setDeviceVerification(trustLevel: DeviceTrustLevel, userId: String, deviceId: String) {
|
||||
setDeviceVerificationAction.handle(trustLevel, userId, deviceId)
|
||||
|
@ -586,10 +586,10 @@ internal class DefaultCryptoService @Inject constructor(
|
|||
/**
|
||||
* Configure a room to use encryption.
|
||||
*
|
||||
* @param roomId the room id to enable encryption in.
|
||||
* @param algorithm the encryption config for the room.
|
||||
* @param roomId the room id to enable encryption in.
|
||||
* @param algorithm the encryption config for the room.
|
||||
* @param inhibitDeviceQuery true to suppress device list query for users in the room (for now)
|
||||
* @param membersId list of members to start tracking their devices
|
||||
* @param membersId list of members to start tracking their devices
|
||||
* @return true if the operation succeeds.
|
||||
*/
|
||||
private suspend fun setEncryptionInRoom(roomId: String,
|
||||
|
@ -687,9 +687,9 @@ internal class DefaultCryptoService @Inject constructor(
|
|||
* Encrypt an event content according to the configuration of the room.
|
||||
*
|
||||
* @param eventContent the content of the event.
|
||||
* @param eventType the type of the event.
|
||||
* @param roomId the room identifier the event will be sent.
|
||||
* @param callback the asynchronous callback
|
||||
* @param eventType the type of the event.
|
||||
* @param roomId the room identifier the event will be sent.
|
||||
* @param callback the asynchronous callback
|
||||
*/
|
||||
override fun encryptEventContent(eventContent: Content,
|
||||
eventType: String,
|
||||
|
@ -742,7 +742,7 @@ internal class DefaultCryptoService @Inject constructor(
|
|||
/**
|
||||
* Decrypt an event.
|
||||
*
|
||||
* @param event the raw event.
|
||||
* @param event the raw event.
|
||||
* @param timeline the id of the timeline where the event is decrypted. It is used to prevent replay attack.
|
||||
* @return the MXEventDecryptionResult data, or throw in case of error
|
||||
*/
|
||||
|
@ -754,7 +754,7 @@ internal class DefaultCryptoService @Inject constructor(
|
|||
/**
|
||||
* Decrypt an event asynchronously.
|
||||
*
|
||||
* @param event the raw event.
|
||||
* @param event the raw event.
|
||||
* @param timeline the id of the timeline where the event is decrypted. It is used to prevent replay attack.
|
||||
* @param callback the callback to return data or null
|
||||
*/
|
||||
|
@ -765,7 +765,7 @@ internal class DefaultCryptoService @Inject constructor(
|
|||
/**
|
||||
* Decrypt an event.
|
||||
*
|
||||
* @param event the raw event.
|
||||
* @param event the raw event.
|
||||
* @param timeline the id of the timeline where the event is decrypted. It is used to prevent replay attack.
|
||||
* @return the MXEventDecryptionResult data, or null in case of error
|
||||
*/
|
||||
|
@ -998,7 +998,7 @@ internal class DefaultCryptoService @Inject constructor(
|
|||
/**
|
||||
* Export the crypto keys.
|
||||
*
|
||||
* @param password the password
|
||||
* @param password the password
|
||||
* @param anIterationCount the encryption iteration count (0 means no encryption)
|
||||
*/
|
||||
private suspend fun exportRoomKeys(password: String, anIterationCount: Int): ByteArray {
|
||||
|
@ -1017,8 +1017,8 @@ internal class DefaultCryptoService @Inject constructor(
|
|||
/**
|
||||
* Import the room keys.
|
||||
*
|
||||
* @param roomKeysAsArray the room keys as array.
|
||||
* @param password the password
|
||||
* @param roomKeysAsArray the room keys as array.
|
||||
* @param password the password
|
||||
* @param progressListener the progress listener
|
||||
* @return the result ImportRoomKeysResult
|
||||
*/
|
||||
|
@ -1068,7 +1068,7 @@ internal class DefaultCryptoService @Inject constructor(
|
|||
* A success means there is no unknown devices.
|
||||
* If there are some unknown devices, a MXCryptoError.UnknownDevice exception is triggered.
|
||||
*
|
||||
* @param userIds the user ids list
|
||||
* @param userIds the user ids list
|
||||
* @param callback the asynchronous callback.
|
||||
*/
|
||||
fun checkUnknownDevices(userIds: List<String>, callback: MatrixCallback<Unit>) {
|
||||
|
@ -1091,7 +1091,7 @@ internal class DefaultCryptoService @Inject constructor(
|
|||
* If false, it can still be overridden per-room.
|
||||
* If true, it overrides the per-room settings.
|
||||
*
|
||||
* @param block true to unilaterally blacklist all
|
||||
* @param block true to unilaterally blacklist all
|
||||
*/
|
||||
override fun setGlobalBlacklistUnverifiedDevices(block: Boolean) {
|
||||
cryptoStore.setGlobalBlacklistUnverifiedDevices(block)
|
||||
|
@ -1131,8 +1131,8 @@ internal class DefaultCryptoService @Inject constructor(
|
|||
/**
|
||||
* Manages the room black-listing for unverified devices.
|
||||
*
|
||||
* @param roomId the room id
|
||||
* @param add true to add the room id to the list, false to remove it.
|
||||
* @param roomId the room id
|
||||
* @param add true to add the room id to the list, false to remove it.
|
||||
*/
|
||||
private fun setRoomBlacklistUnverifiedDevices(roomId: String, add: Boolean) {
|
||||
val roomIds = cryptoStore.getRoomsListBlacklistUnverifiedDevices().toMutableList()
|
||||
|
@ -1151,7 +1151,7 @@ internal class DefaultCryptoService @Inject constructor(
|
|||
/**
|
||||
* Add this room to the ones which don't encrypt messages to unverified devices.
|
||||
*
|
||||
* @param roomId the room id
|
||||
* @param roomId the room id
|
||||
*/
|
||||
override fun setRoomBlacklistUnverifiedDevices(roomId: String) {
|
||||
setRoomBlacklistUnverifiedDevices(roomId, true)
|
||||
|
@ -1160,7 +1160,7 @@ internal class DefaultCryptoService @Inject constructor(
|
|||
/**
|
||||
* Remove this room to the ones which don't encrypt messages to unverified devices.
|
||||
*
|
||||
* @param roomId the room id
|
||||
* @param roomId the room id
|
||||
*/
|
||||
override fun setRoomUnBlacklistUnverifiedDevices(roomId: String) {
|
||||
setRoomBlacklistUnverifiedDevices(roomId, false)
|
||||
|
|
|
@ -170,7 +170,7 @@ internal class DeviceListManager @Inject constructor(
|
|||
* Update the devices list statuses.
|
||||
*
|
||||
* @param changed the user ids list which have new devices
|
||||
* @param left the user ids list which left a room
|
||||
* @param left the user ids list which left a room
|
||||
*/
|
||||
fun handleDeviceListsChanges(changed: Collection<String>, left: Collection<String>) {
|
||||
Timber.v("## CRYPTO: handleDeviceListsChanges changed: ${changed.logLimit()} / left: ${left.logLimit()}")
|
||||
|
@ -223,7 +223,7 @@ internal class DeviceListManager @Inject constructor(
|
|||
/**
|
||||
* The keys download succeeded.
|
||||
*
|
||||
* @param userIds the userIds list
|
||||
* @param userIds the userIds list
|
||||
* @param failures the failure map.
|
||||
*/
|
||||
private fun onKeysDownloadSucceed(userIds: List<String>, failures: Map<String, Map<String, Any>>?): MXUsersDevicesMap<CryptoDeviceInfo> {
|
||||
|
@ -276,7 +276,7 @@ internal class DeviceListManager @Inject constructor(
|
|||
* Download the device keys for a list of users and stores the keys in the MXStore.
|
||||
* It must be called in getEncryptingThreadHandler() thread.
|
||||
*
|
||||
* @param userIds The users to fetch.
|
||||
* @param userIds The users to fetch.
|
||||
* @param forceDownload Always download the keys even if cached.
|
||||
*/
|
||||
suspend fun downloadKeys(userIds: List<String>?, forceDownload: Boolean): MXUsersDevicesMap<CryptoDeviceInfo> {
|
||||
|
@ -421,9 +421,9 @@ internal class DeviceListManager @Inject constructor(
|
|||
* Validate device keys.
|
||||
* This method must called on getEncryptingThreadHandler() thread.
|
||||
*
|
||||
* @param deviceKeys the device keys to validate.
|
||||
* @param userId the id of the user of the device.
|
||||
* @param deviceId the id of the device.
|
||||
* @param deviceKeys the device keys to validate.
|
||||
* @param userId the id of the user of the device.
|
||||
* @param deviceId the id of the device.
|
||||
* @param previouslyStoredDeviceKeys the device keys we received before for this device
|
||||
* @return true if succeeds
|
||||
*/
|
||||
|
|
|
@ -72,7 +72,7 @@ internal class EventDecryptor @Inject constructor(
|
|||
/**
|
||||
* Decrypt an event.
|
||||
*
|
||||
* @param event the raw event.
|
||||
* @param event the raw event.
|
||||
* @param timeline the id of the timeline where the event is decrypted. It is used to prevent replay attack.
|
||||
* @return the MXEventDecryptionResult data, or throw in case of error
|
||||
*/
|
||||
|
@ -84,7 +84,7 @@ internal class EventDecryptor @Inject constructor(
|
|||
/**
|
||||
* Decrypt an event asynchronously.
|
||||
*
|
||||
* @param event the raw event.
|
||||
* @param event the raw event.
|
||||
* @param timeline the id of the timeline where the event is decrypted. It is used to prevent replay attack.
|
||||
* @param callback the callback to return data or null
|
||||
*/
|
||||
|
@ -100,7 +100,7 @@ internal class EventDecryptor @Inject constructor(
|
|||
/**
|
||||
* Decrypt an event.
|
||||
*
|
||||
* @param event the raw event.
|
||||
* @param event the raw event.
|
||||
* @param timeline the id of the timeline where the event is decrypted. It is used to prevent replay attack.
|
||||
* @return the MXEventDecryptionResult data, or null in case of error
|
||||
*/
|
||||
|
|
|
@ -68,7 +68,7 @@ internal object MXMegolmExportEncryption {
|
|||
/**
|
||||
* Decrypt a megolm key file.
|
||||
*
|
||||
* @param data the data to decrypt
|
||||
* @param data the data to decrypt
|
||||
* @param password the password.
|
||||
* @return the decrypted output.
|
||||
* @throws Exception the failure reason
|
||||
|
@ -138,9 +138,9 @@ internal object MXMegolmExportEncryption {
|
|||
/**
|
||||
* Encrypt a string into the megolm export format.
|
||||
*
|
||||
* @param data the data to encrypt.
|
||||
* @param password the password
|
||||
* @param kdfRounds the iteration count
|
||||
* @param data the data to encrypt.
|
||||
* @param password the password
|
||||
* @param kdfRounds the iteration count
|
||||
* @return the encrypted data
|
||||
* @throws Exception the failure reason
|
||||
*/
|
||||
|
@ -304,9 +304,9 @@ internal object MXMegolmExportEncryption {
|
|||
/**
|
||||
* Derive the AES and HMAC-SHA-256 keys for the file.
|
||||
*
|
||||
* @param salt salt for pbkdf
|
||||
* @param salt salt for pbkdf
|
||||
* @param iterations number of pbkdf iterations
|
||||
* @param password password
|
||||
* @param password password
|
||||
* @return the derived keys
|
||||
*/
|
||||
@Throws(Exception::class)
|
||||
|
|
|
@ -260,7 +260,7 @@ internal class MXOlmDevice @Inject constructor(
|
|||
* The new session will be stored in the MXStore.
|
||||
*
|
||||
* @param theirIdentityKey the remote user's Curve25519 identity key
|
||||
* @param theirOneTimeKey the remote user's one-time Curve25519 key
|
||||
* @param theirOneTimeKey the remote user's one-time Curve25519 key
|
||||
* @return the session id for the outbound session.
|
||||
*/
|
||||
fun createOutboundSession(theirIdentityKey: String, theirOneTimeKey: String): String? {
|
||||
|
@ -299,8 +299,8 @@ internal class MXOlmDevice @Inject constructor(
|
|||
* Generate a new inbound session, given an incoming message.
|
||||
*
|
||||
* @param theirDeviceIdentityKey the remote user's Curve25519 identity key.
|
||||
* @param messageType the message_type field from the received message (must be 0).
|
||||
* @param ciphertext base64-encoded body from the received message.
|
||||
* @param messageType the message_type field from the received message (must be 0).
|
||||
* @param ciphertext base64-encoded body from the received message.
|
||||
* @return {{payload: string, session_id: string}} decrypted payload, and session id of new session.
|
||||
*/
|
||||
fun createInboundSession(theirDeviceIdentityKey: String, messageType: Int, ciphertext: String): Map<String, String>? {
|
||||
|
@ -394,8 +394,8 @@ internal class MXOlmDevice @Inject constructor(
|
|||
* Encrypt an outgoing message using an existing session.
|
||||
*
|
||||
* @param theirDeviceIdentityKey the Curve25519 identity key for the remote device.
|
||||
* @param sessionId the id of the active session
|
||||
* @param payloadString the payload to be encrypted and sent
|
||||
* @param sessionId the id of the active session
|
||||
* @param payloadString the payload to be encrypted and sent
|
||||
* @return the cipher text
|
||||
*/
|
||||
suspend fun encryptMessage(theirDeviceIdentityKey: String, sessionId: String, payloadString: String): Map<String, Any>? {
|
||||
|
@ -427,9 +427,9 @@ internal class MXOlmDevice @Inject constructor(
|
|||
/**
|
||||
* Decrypt an incoming message using an existing session.
|
||||
*
|
||||
* @param ciphertext the base64-encoded body from the received message.
|
||||
* @param messageType message_type field from the received message.
|
||||
* @param sessionId the id of the active session.
|
||||
* @param ciphertext the base64-encoded body from the received message.
|
||||
* @param messageType message_type field from the received message.
|
||||
* @param sessionId the id of the active session.
|
||||
* @param theirDeviceIdentityKey the Curve25519 identity key for the remote device.
|
||||
* @return the decrypted payload.
|
||||
*/
|
||||
|
@ -460,9 +460,9 @@ internal class MXOlmDevice @Inject constructor(
|
|||
* Determine if an incoming messages is a prekey message matching an existing session.
|
||||
*
|
||||
* @param theirDeviceIdentityKey the Curve25519 identity key for the remote device.
|
||||
* @param sessionId the id of the active session.
|
||||
* @param messageType message_type field from the received message.
|
||||
* @param ciphertext the base64-encoded body from the received message.
|
||||
* @param sessionId the id of the active session.
|
||||
* @param messageType message_type field from the received message.
|
||||
* @param ciphertext the base64-encoded body from the received message.
|
||||
* @return YES if the received message is a prekey message which matchesthe given session.
|
||||
*/
|
||||
fun matchesSession(theirDeviceIdentityKey: String, sessionId: String, messageType: Int, ciphertext: String): Boolean {
|
||||
|
@ -563,7 +563,7 @@ internal class MXOlmDevice @Inject constructor(
|
|||
/**
|
||||
* Encrypt an outgoing message with an outbound group session.
|
||||
*
|
||||
* @param sessionId the id of the outbound group session.
|
||||
* @param sessionId the id of the outbound group session.
|
||||
* @param payloadString the payload to be encrypted and sent.
|
||||
* @return ciphertext
|
||||
*/
|
||||
|
@ -590,13 +590,13 @@ internal class MXOlmDevice @Inject constructor(
|
|||
/**
|
||||
* Add an inbound group session to the session store.
|
||||
*
|
||||
* @param sessionId the session identifier.
|
||||
* @param sessionKey base64-encoded secret key.
|
||||
* @param roomId the id of the room in which this session will be used.
|
||||
* @param senderKey the base64-encoded curve25519 key of the sender.
|
||||
* @param sessionId the session identifier.
|
||||
* @param sessionKey base64-encoded secret key.
|
||||
* @param roomId the id of the room in which this session will be used.
|
||||
* @param senderKey the base64-encoded curve25519 key of the sender.
|
||||
* @param forwardingCurve25519KeyChain Devices involved in forwarding this session to us.
|
||||
* @param keysClaimed Other keys the sender claims.
|
||||
* @param exportFormat true if the megolm keys are in export format
|
||||
* @param keysClaimed Other keys the sender claims.
|
||||
* @param exportFormat true if the megolm keys are in export format
|
||||
* @return true if the operation succeeds.
|
||||
*/
|
||||
fun addInboundGroupSession(sessionId: String,
|
||||
|
@ -752,9 +752,9 @@ internal class MXOlmDevice @Inject constructor(
|
|||
/**
|
||||
* Decrypt a received message with an inbound group session.
|
||||
*
|
||||
* @param body the base64-encoded body of the encrypted message.
|
||||
* @param roomId the room in which the message was received.
|
||||
* @param timeline the id of the timeline where the event is decrypted. It is used to prevent replay attack.
|
||||
* @param body the base64-encoded body of the encrypted message.
|
||||
* @param roomId the room in which the message was received.
|
||||
* @param timeline the id of the timeline where the event is decrypted. It is used to prevent replay attack.
|
||||
* @param sessionId the session identifier.
|
||||
* @param senderKey the base64-encoded curve25519 key of the sender.
|
||||
* @return the decrypting result. Nil if the sessionId is unknown.
|
||||
|
@ -834,9 +834,9 @@ internal class MXOlmDevice @Inject constructor(
|
|||
/**
|
||||
* Verify an ed25519 signature on a JSON object.
|
||||
*
|
||||
* @param key the ed25519 key.
|
||||
* @param key the ed25519 key.
|
||||
* @param jsonDictionary the JSON object which was signed.
|
||||
* @param signature the base64-encoded signature to be checked.
|
||||
* @param signature the base64-encoded signature to be checked.
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
@Throws(Exception::class)
|
||||
|
@ -859,7 +859,7 @@ internal class MXOlmDevice @Inject constructor(
|
|||
* Search an OlmSession.
|
||||
*
|
||||
* @param theirDeviceIdentityKey the device key
|
||||
* @param sessionId the session Id
|
||||
* @param sessionId the session Id
|
||||
* @return the olm session
|
||||
*/
|
||||
private fun getSessionForDevice(theirDeviceIdentityKey: String, sessionId: String): OlmSessionWrapper? {
|
||||
|
@ -875,7 +875,7 @@ internal class MXOlmDevice @Inject constructor(
|
|||
*
|
||||
* @param sessionId the session identifier.
|
||||
* @param senderKey the base64-encoded curve25519 key of the sender.
|
||||
* @param roomId the room where the session is used.
|
||||
* @param roomId the room where the session is used.
|
||||
* @return the inbound group session.
|
||||
*/
|
||||
fun getInboundGroupSession(sessionId: String?, senderKey: String?, roomId: String?): InboundGroupSessionHolder {
|
||||
|
@ -905,7 +905,7 @@ internal class MXOlmDevice @Inject constructor(
|
|||
/**
|
||||
* Determine if we have the keys for a given megolm session.
|
||||
*
|
||||
* @param roomId room in which the message was received
|
||||
* @param roomId room in which the message was received
|
||||
* @param senderKey base64-encoded curve25519 key of the sender
|
||||
* @param sessionId session identifier
|
||||
* @return true if the unbound session keys are known.
|
||||
|
|
|
@ -39,7 +39,7 @@ internal class OlmSessionStore @Inject constructor(private val store: IMXCryptoS
|
|||
* Store a session between our own device and another device.
|
||||
* This will be called after the session has been created but also every time it has been used
|
||||
* in order to persist the correct state for next run
|
||||
* @param olmSessionWrapper the end-to-end session.
|
||||
* @param olmSessionWrapper the end-to-end session.
|
||||
* @param deviceKey the public key of the other device.
|
||||
*/
|
||||
@Synchronized
|
||||
|
|
|
@ -49,7 +49,7 @@ internal class RoomDecryptorProvider @Inject constructor(
|
|||
* If we already have a decryptor for the given room and algorithm, return
|
||||
* it. Otherwise try to instantiate it.
|
||||
*
|
||||
* @param roomId the room id
|
||||
* @param roomId the room id
|
||||
* @param algorithm the crypto algorithm
|
||||
* @return the decryptor
|
||||
* // TODO Create another method for the case of roomId is null
|
||||
|
|
|
@ -29,7 +29,7 @@ internal class EnsureOlmSessionsForUsersAction @Inject constructor(private val o
|
|||
|
||||
/**
|
||||
* Try to make sure we have established olm sessions for the given users.
|
||||
* @param users a list of user ids.
|
||||
* @param users a list of user ids.
|
||||
*/
|
||||
suspend fun handle(users: List<String>): MXUsersDevicesMap<MXOlmSessionResult> {
|
||||
Timber.v("## ensureOlmSessionsForUsers() : ensureOlmSessionsForUsers $users")
|
||||
|
|
|
@ -45,8 +45,8 @@ internal class MegolmSessionDataImporter @Inject constructor(private val olmDevi
|
|||
* Must be call on the crypto coroutine thread
|
||||
*
|
||||
* @param megolmSessionsData megolm sessions.
|
||||
* @param fromBackup true if the imported keys are already backed up on the server.
|
||||
* @param progressListener the progress listener
|
||||
* @param fromBackup true if the imported keys are already backed up on the server.
|
||||
* @param progressListener the progress listener
|
||||
* @return import room keys result
|
||||
*/
|
||||
@WorkerThread
|
||||
|
|
|
@ -42,7 +42,7 @@ internal class MessageEncrypter @Inject constructor(
|
|||
* This method must be called from the getCryptoHandler() thread.
|
||||
*
|
||||
* @param payloadFields fields to include in the encrypted payload.
|
||||
* @param deviceInfos list of device infos to encrypt for.
|
||||
* @param deviceInfos list of device infos to encrypt for.
|
||||
* @return the content for an m.room.encrypted event.
|
||||
*/
|
||||
suspend fun encryptMessage(payloadFields: Content, deviceInfos: List<CryptoDeviceInfo>): EncryptedMessage {
|
||||
|
|
|
@ -29,7 +29,7 @@ internal interface IMXDecrypting {
|
|||
/**
|
||||
* Decrypt an event.
|
||||
*
|
||||
* @param event the raw event.
|
||||
* @param event the raw event.
|
||||
* @param timeline the id of the timeline where the event is decrypted. It is used to prevent replay attack.
|
||||
* @return the decryption information, or an error
|
||||
*/
|
||||
|
|
|
@ -27,8 +27,8 @@ internal interface IMXEncrypting {
|
|||
* Encrypt an event content according to the configuration of the room.
|
||||
*
|
||||
* @param eventContent the content of the event.
|
||||
* @param eventType the type of the event.
|
||||
* @param userIds the room members the event will be sent to.
|
||||
* @param eventType the type of the event.
|
||||
* @param userIds the room members the event will be sent to.
|
||||
* @return the encrypted content
|
||||
*/
|
||||
suspend fun encryptEventContent(eventContent: Content, eventType: String, userIds: List<String>): Content
|
||||
|
|
|
@ -198,7 +198,7 @@ internal class MXMegolmEncryption(
|
|||
/**
|
||||
* Share the device key to a list of users.
|
||||
*
|
||||
* @param session the session info
|
||||
* @param session the session info
|
||||
* @param devicesByUsers the devices map
|
||||
*/
|
||||
private suspend fun shareKey(session: MXOutboundSessionInfo,
|
||||
|
@ -227,7 +227,7 @@ internal class MXMegolmEncryption(
|
|||
/**
|
||||
* Share the device keys of a an user.
|
||||
*
|
||||
* @param session the session info
|
||||
* @param session the session info
|
||||
* @param devicesByUser the devices map
|
||||
*/
|
||||
private suspend fun shareUserDevicesKey(session: MXOutboundSessionInfo,
|
||||
|
@ -387,7 +387,7 @@ internal class MXMegolmEncryption(
|
|||
* Get the list of devices which can encrypt data to.
|
||||
* This method must be called in getDecryptingThreadHandler() thread.
|
||||
*
|
||||
* @param userIds the user ids whose devices must be checked.
|
||||
* @param userIds the user ids whose devices must be checked.
|
||||
*/
|
||||
private suspend fun getDevicesInRoom(userIds: List<String>): DeviceInRoomInfo {
|
||||
// We are happy to use a cached version here: we assume that if we already
|
||||
|
|
|
@ -180,7 +180,7 @@ internal class MXOlmDecryption(
|
|||
/**
|
||||
* Attempt to decrypt an Olm message.
|
||||
*
|
||||
* @param message message object, with 'type' and 'body' fields.
|
||||
* @param message message object, with 'type' and 'body' fields.
|
||||
* @param theirDeviceIdentityKey the Curve25519 identity key of the sender.
|
||||
* @return payload, if decrypted successfully.
|
||||
*/
|
||||
|
|
|
@ -70,7 +70,7 @@ internal class MXOlmEncryption(
|
|||
/**
|
||||
* Ensure that the session.
|
||||
*
|
||||
* @param users the user ids list
|
||||
* @param users the user ids list
|
||||
*/
|
||||
private suspend fun ensureSession(users: List<String>) {
|
||||
deviceListManager.downloadKeys(users, false)
|
||||
|
|
|
@ -112,9 +112,9 @@ internal interface CryptoApi {
|
|||
* Send an event to a specific list of devices
|
||||
* Doc: https://matrix.org/docs/spec/client_server/r0.4.0.html#put-matrix-client-r0-sendtodevice-eventtype-txnid
|
||||
*
|
||||
* @param eventType the type of event to send
|
||||
* @param eventType the type of event to send
|
||||
* @param transactionId the transaction ID for this event
|
||||
* @param body the body
|
||||
* @param body the body
|
||||
*/
|
||||
@PUT(NetworkConstants.URI_API_PREFIX_PATH_R0 + "sendToDevice/{eventType}/{txnId}")
|
||||
suspend fun sendToDevice(@Path("eventType") eventType: String,
|
||||
|
@ -126,7 +126,7 @@ internal interface CryptoApi {
|
|||
* Doc: https://matrix.org/docs/spec/client_server/r0.4.0.html#delete-matrix-client-r0-devices-deviceid
|
||||
*
|
||||
* @param deviceId the device id
|
||||
* @param params the deletion parameters
|
||||
* @param params the deletion parameters
|
||||
*/
|
||||
@HTTP(path = NetworkConstants.URI_API_PREFIX_PATH_R0 + "devices/{device_id}", method = "DELETE", hasBody = true)
|
||||
suspend fun deleteDevice(@Path("device_id") deviceId: String,
|
||||
|
@ -137,7 +137,7 @@ internal interface CryptoApi {
|
|||
* Doc: https://matrix.org/docs/spec/client_server/r0.4.0.html#put-matrix-client-r0-devices-deviceid
|
||||
*
|
||||
* @param deviceId the device id
|
||||
* @param params the params
|
||||
* @param params the params
|
||||
*/
|
||||
@PUT(NetworkConstants.URI_API_PREFIX_PATH_R0 + "devices/{device_id}")
|
||||
suspend fun updateDeviceInfo(@Path("device_id") deviceId: String,
|
||||
|
|
|
@ -232,8 +232,8 @@ internal object MXEncryptedAttachments {
|
|||
*
|
||||
* @param attachmentStream the attachment stream. Will be closed after this method call.
|
||||
* @param elementToDecrypt the elementToDecrypt info
|
||||
* @param outputStream the outputStream where the decrypted attachment will be write.
|
||||
* @param clock a clock to retrieve current time
|
||||
* @param outputStream the outputStream where the decrypted attachment will be write.
|
||||
* @param clock a clock to retrieve current time
|
||||
* @return true in case of success, false in case of error
|
||||
*/
|
||||
fun decryptAttachment(attachmentStream: InputStream?,
|
||||
|
|
|
@ -60,14 +60,14 @@ internal interface RoomKeysApi {
|
|||
* Get information about the given version.
|
||||
* If not supported by the server, an error is returned: {"errcode":"M_NOT_FOUND","error":"No backup found"}
|
||||
*
|
||||
* @param version version
|
||||
* @param version version
|
||||
*/
|
||||
@GET(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "room_keys/version/{version}")
|
||||
suspend fun getKeysBackupVersion(@Path("version") version: String): KeysVersionResult
|
||||
|
||||
/**
|
||||
* Update information about the given version.
|
||||
* @param version version
|
||||
* @param version version
|
||||
* @param updateKeysBackupVersionBody the body
|
||||
*/
|
||||
@PUT(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "room_keys/version/{version}")
|
||||
|
@ -87,9 +87,9 @@ internal interface RoomKeysApi {
|
|||
* flag (true is better than false), then by the first_message_index (a lower number is better), and finally by
|
||||
* forwarded_count (a lower number is better).
|
||||
*
|
||||
* @param roomId the room id
|
||||
* @param sessionId the session id
|
||||
* @param version the version of the backup
|
||||
* @param roomId the room id
|
||||
* @param sessionId the session id
|
||||
* @param version the version of the backup
|
||||
* @param keyBackupData the data to send
|
||||
*/
|
||||
@PUT(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "room_keys/keys/{roomId}/{sessionId}")
|
||||
|
@ -101,8 +101,8 @@ internal interface RoomKeysApi {
|
|||
/**
|
||||
* Store several keys for the given room, using the given backup version.
|
||||
*
|
||||
* @param roomId the room id
|
||||
* @param version the version of the backup
|
||||
* @param roomId the room id
|
||||
* @param version the version of the backup
|
||||
* @param roomKeysBackupData the data to send
|
||||
*/
|
||||
@PUT(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "room_keys/keys/{roomId}")
|
||||
|
@ -113,7 +113,7 @@ internal interface RoomKeysApi {
|
|||
/**
|
||||
* Store several keys, using the given backup version.
|
||||
*
|
||||
* @param version the version of the backup
|
||||
* @param version the version of the backup
|
||||
* @param keysBackupData the data to send
|
||||
*/
|
||||
@PUT(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "room_keys/keys")
|
||||
|
@ -127,9 +127,9 @@ internal interface RoomKeysApi {
|
|||
/**
|
||||
* Retrieve the key for the given session in the given room from the backup.
|
||||
*
|
||||
* @param roomId the room id
|
||||
* @param roomId the room id
|
||||
* @param sessionId the session id
|
||||
* @param version the version of the backup, or empty String to retrieve the last version
|
||||
* @param version the version of the backup, or empty String to retrieve the last version
|
||||
*/
|
||||
@GET(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "room_keys/keys/{roomId}/{sessionId}")
|
||||
suspend fun getRoomSessionData(@Path("roomId") roomId: String,
|
||||
|
@ -139,8 +139,8 @@ internal interface RoomKeysApi {
|
|||
/**
|
||||
* Retrieve all the keys for the given room from the backup.
|
||||
*
|
||||
* @param roomId the room id
|
||||
* @param version the version of the backup, or empty String to retrieve the last version
|
||||
* @param roomId the room id
|
||||
* @param version the version of the backup, or empty String to retrieve the last version
|
||||
*/
|
||||
@GET(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "room_keys/keys/{roomId}")
|
||||
suspend fun getRoomSessionsData(@Path("roomId") roomId: String,
|
||||
|
@ -149,7 +149,7 @@ internal interface RoomKeysApi {
|
|||
/**
|
||||
* Retrieve all the keys from the backup.
|
||||
*
|
||||
* @param version the version of the backup, or empty String to retrieve the last version
|
||||
* @param version the version of the backup, or empty String to retrieve the last version
|
||||
*/
|
||||
@GET(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "room_keys/keys")
|
||||
suspend fun getSessionsData(@Query("version") version: String): KeysBackupData
|
||||
|
|
|
@ -59,7 +59,7 @@ internal data class MXKey(
|
|||
/**
|
||||
* Returns a signature for an user Id and a signkey.
|
||||
*
|
||||
* @param userId the user id
|
||||
* @param userId the user id
|
||||
* @param signkey the sign key
|
||||
* @return the signature
|
||||
*/
|
||||
|
|
|
@ -170,7 +170,7 @@ internal interface IMXCryptoStore {
|
|||
/**
|
||||
* Retrieve a device for a user.
|
||||
*
|
||||
* @param userId the user's id.
|
||||
* @param userId the user's id.
|
||||
* @param deviceId the device id.
|
||||
* @return the device
|
||||
*/
|
||||
|
@ -187,7 +187,7 @@ internal interface IMXCryptoStore {
|
|||
/**
|
||||
* Store the known devices for a user.
|
||||
*
|
||||
* @param userId The user's id.
|
||||
* @param userId The user's id.
|
||||
* @param devices A map from device id to 'MXDevice' object for the device.
|
||||
*/
|
||||
fun storeUserDevices(userId: String, devices: Map<String, CryptoDeviceInfo>?)
|
||||
|
@ -223,7 +223,7 @@ internal interface IMXCryptoStore {
|
|||
/**
|
||||
* Store the crypto algorithm for a room.
|
||||
*
|
||||
* @param roomId the id of the room.
|
||||
* @param roomId the id of the room.
|
||||
* @param algorithm the algorithm.
|
||||
*/
|
||||
fun storeRoomAlgorithm(roomId: String, algorithm: String?)
|
||||
|
@ -251,7 +251,7 @@ internal interface IMXCryptoStore {
|
|||
/**
|
||||
* Store a session between the logged-in user and another device.
|
||||
*
|
||||
* @param olmSessionWrapper the end-to-end session.
|
||||
* @param olmSessionWrapper the end-to-end session.
|
||||
* @param deviceKey the public key of the other device.
|
||||
*/
|
||||
fun storeSession(olmSessionWrapper: OlmSessionWrapper, deviceKey: String)
|
||||
|
@ -359,7 +359,7 @@ internal interface IMXCryptoStore {
|
|||
/**
|
||||
* Get the tracking status of a specified userId devices.
|
||||
*
|
||||
* @param userId the user id
|
||||
* @param userId the user id
|
||||
* @param defaultValue the default value
|
||||
* @return the tracking status
|
||||
*/
|
||||
|
|
|
@ -35,7 +35,7 @@ internal object HkdfSha256 {
|
|||
/**
|
||||
* HkdfSha256-Extract(salt, IKM) -> PRK.
|
||||
*
|
||||
* @param salt optional salt value (a non-secret random value);
|
||||
* @param salt optional salt value (a non-secret random value);
|
||||
* if not provided, it is set to a string of HashLen (size in octets) zeros.
|
||||
* @param ikm input keying material
|
||||
*/
|
||||
|
|
|
@ -612,7 +612,7 @@ public class HomeServerConnectionConfig {
|
|||
* - https://www.ssi.gouv.fr/uploads/2017/02/security-recommendations-for-tls_v1.1.pdf
|
||||
* - https://developer.android.com/reference/javax/net/ssl/SSLEngine
|
||||
*
|
||||
* @param tlsLimitations true to use Tls limitations
|
||||
* @param tlsLimitations true to use Tls limitations
|
||||
* @param enableCompatibilityMode set to true for Android < 20
|
||||
* @return this builder
|
||||
*/
|
||||
|
@ -649,7 +649,7 @@ public class HomeServerConnectionConfig {
|
|||
|
||||
/**
|
||||
* @param proxyHostname Proxy Hostname
|
||||
* @param proxyPort Proxy Port
|
||||
* @param proxyPort Proxy Port
|
||||
* @return this builder
|
||||
*/
|
||||
public Builder withProxy(@Nullable String proxyHostname, int proxyPort) {
|
||||
|
|
|
@ -25,7 +25,7 @@ import javax.net.ssl.X509TrustManager
|
|||
* Implements a TrustManager that checks Certificates against an explicit list of known
|
||||
* fingerprints.
|
||||
*
|
||||
* @property fingerprints Not empty array of SHA256 cert fingerprints
|
||||
* @property fingerprints Not empty array of SHA256 cert fingerprints
|
||||
* @property defaultTrustManager Optional trust manager to fall back on if cert does not match
|
||||
* any of the fingerprints. Can be null.
|
||||
*/
|
||||
|
|
|
@ -29,7 +29,7 @@ import javax.net.ssl.X509ExtendedTrustManager
|
|||
* Implements a TrustManager that checks Certificates against an explicit list of known
|
||||
* fingerprints.
|
||||
*
|
||||
* @property fingerprints An array of SHA256 cert fingerprints
|
||||
* @property fingerprints An array of SHA256 cert fingerprints
|
||||
* @property defaultTrustManager Optional trust manager to fall back on if cert does not match
|
||||
* any of the fingerprints. Can be null.
|
||||
*/
|
||||
|
|
|
@ -28,7 +28,7 @@ internal interface FilterApi {
|
|||
* Upload FilterBody to get a filter_id which can be used for /sync requests.
|
||||
*
|
||||
* @param userId the user id
|
||||
* @param body the Json representation of a FilterBody object
|
||||
* @param body the Json representation of a FilterBody object
|
||||
*/
|
||||
@POST(NetworkConstants.URI_API_PREFIX_PATH_R0 + "user/{userId}/filter")
|
||||
suspend fun uploadFilter(@Path("userId") userId: String,
|
||||
|
@ -37,7 +37,7 @@ internal interface FilterApi {
|
|||
/**
|
||||
* Gets a filter with a given filterId from the homeserver.
|
||||
*
|
||||
* @param userId the user id
|
||||
* @param userId the user id
|
||||
* @param filterId the filterID
|
||||
* @return Filter
|
||||
*/
|
||||
|
|
|
@ -25,7 +25,7 @@ internal object FilterUtil {
|
|||
* FIXME New expected filter:
|
||||
* "{\"room\": {\"ephemeral\": {\"notTypes\": [\"m.typing\"]}}, \"presence\":{\"notTypes\": [\"*\"]}}"
|
||||
*
|
||||
* @param filterBody filterBody to patch
|
||||
* @param filterBody filterBody to patch
|
||||
* @param useDataSaveMode true to enable data save mode
|
||||
*/
|
||||
/*
|
||||
|
|
|
@ -33,7 +33,7 @@ internal interface PushRulesApi {
|
|||
/**
|
||||
* Update the ruleID enable status.
|
||||
*
|
||||
* @param kind the notification kind (sender, room...)
|
||||
* @param kind the notification kind (sender, room...)
|
||||
* @param ruleId the ruleId
|
||||
* @param enabledBody the new enable status
|
||||
*/
|
||||
|
@ -46,8 +46,8 @@ internal interface PushRulesApi {
|
|||
* Update the ruleID action.
|
||||
* Ref: https://matrix.org/docs/spec/client_server/latest#put-matrix-client-r0-pushrules-scope-kind-ruleid-actions
|
||||
*
|
||||
* @param kind the notification kind (sender, room...)
|
||||
* @param ruleId the ruleId
|
||||
* @param kind the notification kind (sender, room...)
|
||||
* @param ruleId the ruleId
|
||||
* @param actions the actions
|
||||
*/
|
||||
@PUT(NetworkConstants.URI_API_PREFIX_PATH_R0 + "pushrules/global/{kind}/{ruleId}/actions")
|
||||
|
@ -58,7 +58,7 @@ internal interface PushRulesApi {
|
|||
/**
|
||||
* Delete a rule.
|
||||
*
|
||||
* @param kind the notification kind (sender, room...)
|
||||
* @param kind the notification kind (sender, room...)
|
||||
* @param ruleId the ruleId
|
||||
*/
|
||||
@DELETE(NetworkConstants.URI_API_PREFIX_PATH_R0 + "pushrules/global/{kind}/{ruleId}")
|
||||
|
@ -68,9 +68,9 @@ internal interface PushRulesApi {
|
|||
/**
|
||||
* Add the ruleID enable status.
|
||||
*
|
||||
* @param kind the notification kind (sender, room...)
|
||||
* @param kind the notification kind (sender, room...)
|
||||
* @param ruleId the ruleId.
|
||||
* @param rule the rule to add.
|
||||
* @param rule the rule to add.
|
||||
*/
|
||||
@PUT(NetworkConstants.URI_API_PREFIX_PATH_R0 + "pushrules/global/{kind}/{ruleId}")
|
||||
suspend fun addRule(@Path("kind") kind: String,
|
||||
|
|
|
@ -78,9 +78,9 @@ internal interface RoomAPI {
|
|||
* Get a list of messages starting from a reference.
|
||||
*
|
||||
* @param roomId the room id
|
||||
* @param from the token identifying where to start. Required.
|
||||
* @param dir The direction to return messages from. Required.
|
||||
* @param limit the maximum number of messages to retrieve. Optional.
|
||||
* @param from the token identifying where to start. Required.
|
||||
* @param dir The direction to return messages from. Required.
|
||||
* @param limit the maximum number of messages to retrieve. Optional.
|
||||
* @param filter A JSON RoomEventFilter to filter returned events with. Optional.
|
||||
*/
|
||||
@GET(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/messages")
|
||||
|
@ -94,9 +94,9 @@ internal interface RoomAPI {
|
|||
/**
|
||||
* Get all members of a room.
|
||||
*
|
||||
* @param roomId the room id where to get the members
|
||||
* @param syncToken the sync token (optional)
|
||||
* @param membership to include only one type of membership (optional)
|
||||
* @param roomId the room id where to get the members
|
||||
* @param syncToken the sync token (optional)
|
||||
* @param membership to include only one type of membership (optional)
|
||||
* @param notMembership to exclude one type of membership (optional)
|
||||
*/
|
||||
@GET(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/members")
|
||||
|
@ -109,10 +109,10 @@ internal interface RoomAPI {
|
|||
/**
|
||||
* Send an event to a room.
|
||||
*
|
||||
* @param txId the transaction Id
|
||||
* @param roomId the room id
|
||||
* @param txId the transaction Id
|
||||
* @param roomId the room id
|
||||
* @param eventType the event type
|
||||
* @param content the event content
|
||||
* @param content the event content
|
||||
*/
|
||||
@PUT(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/send/{eventType}/{txId}")
|
||||
suspend fun send(@Path("txId") txId: String,
|
||||
|
@ -124,10 +124,10 @@ internal interface RoomAPI {
|
|||
/**
|
||||
* Get the context surrounding an event.
|
||||
*
|
||||
* @param roomId the room id
|
||||
* @param roomId the room id
|
||||
* @param eventId the event Id
|
||||
* @param limit the maximum number of messages to retrieve
|
||||
* @param filter A JSON RoomEventFilter to filter returned events with. Optional.
|
||||
* @param limit the maximum number of messages to retrieve
|
||||
* @param filter A JSON RoomEventFilter to filter returned events with. Optional.
|
||||
*/
|
||||
@GET(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/context/{eventId}")
|
||||
suspend fun getContextOfEvent(@Path("roomId") roomId: String,
|
||||
|
@ -138,7 +138,7 @@ internal interface RoomAPI {
|
|||
/**
|
||||
* Retrieve an event from its room id / events id.
|
||||
*
|
||||
* @param roomId the room id
|
||||
* @param roomId the room id
|
||||
* @param eventId the event Id
|
||||
*/
|
||||
@GET(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/event/{eventId}")
|
||||
|
@ -148,7 +148,7 @@ internal interface RoomAPI {
|
|||
/**
|
||||
* Send read markers.
|
||||
*
|
||||
* @param roomId the room id
|
||||
* @param roomId the room id
|
||||
* @param markers the read markers
|
||||
*/
|
||||
@POST(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/read_markers")
|
||||
|
@ -169,7 +169,7 @@ internal interface RoomAPI {
|
|||
* Ref: https://matrix.org/docs/spec/client_server/r0.4.0.html#post-matrix-client-r0-rooms-roomid-invite
|
||||
*
|
||||
* @param roomId the room id
|
||||
* @param body a object that just contains a user id
|
||||
* @param body a object that just contains a user id
|
||||
*/
|
||||
@POST(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/invite")
|
||||
suspend fun invite(@Path("roomId") roomId: String,
|
||||
|
@ -188,9 +188,9 @@ internal interface RoomAPI {
|
|||
/**
|
||||
* Send a generic state event.
|
||||
*
|
||||
* @param roomId the room id.
|
||||
* @param roomId the room id.
|
||||
* @param stateEventType the state event type
|
||||
* @param params the request parameters
|
||||
* @param params the request parameters
|
||||
*/
|
||||
@PUT(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/state/{state_event_type}")
|
||||
suspend fun sendStateEvent(@Path("roomId") roomId: String,
|
||||
|
@ -201,10 +201,10 @@ internal interface RoomAPI {
|
|||
/**
|
||||
* Send a generic state event.
|
||||
*
|
||||
* @param roomId the room id.
|
||||
* @param roomId the room id.
|
||||
* @param stateEventType the state event type
|
||||
* @param stateKey the state keys
|
||||
* @param params the request parameters
|
||||
* @param stateKey the state keys
|
||||
* @param params the request parameters
|
||||
*/
|
||||
@PUT(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/state/{state_event_type}/{state_key}")
|
||||
suspend fun sendStateEvent(@Path("roomId") roomId: String,
|
||||
|
@ -274,7 +274,7 @@ internal interface RoomAPI {
|
|||
/**
|
||||
* Leave the given room.
|
||||
*
|
||||
* @param roomId the room id
|
||||
* @param roomId the room id
|
||||
* @param params the request body
|
||||
*/
|
||||
@POST(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/leave")
|
||||
|
@ -284,7 +284,7 @@ internal interface RoomAPI {
|
|||
/**
|
||||
* Ban a user from the given room.
|
||||
*
|
||||
* @param roomId the room id
|
||||
* @param roomId the room id
|
||||
* @param userIdAndReason the banned user object (userId and reason for ban)
|
||||
*/
|
||||
@POST(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/ban")
|
||||
|
@ -294,7 +294,7 @@ internal interface RoomAPI {
|
|||
/**
|
||||
* unban a user from the given room.
|
||||
*
|
||||
* @param roomId the room id
|
||||
* @param roomId the room id
|
||||
* @param userIdAndReason the unbanned user object (userId and reason for unban)
|
||||
*/
|
||||
@POST(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/unban")
|
||||
|
@ -304,7 +304,7 @@ internal interface RoomAPI {
|
|||
/**
|
||||
* Kick a user from the given room.
|
||||
*
|
||||
* @param roomId the room id
|
||||
* @param roomId the room id
|
||||
* @param userIdAndReason the kicked user object (userId and reason for kicking)
|
||||
*/
|
||||
@POST(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/kick")
|
||||
|
@ -316,10 +316,10 @@ internal interface RoomAPI {
|
|||
* This cannot be undone.
|
||||
* Users may redact their own events, and any user with a power level greater than or equal to the redact power level of the room may redact events there.
|
||||
*
|
||||
* @param txId the transaction Id
|
||||
* @param roomId the room id
|
||||
* @param eventId the event to delete
|
||||
* @param reason json containing reason key {"reason": "Indecent material"}
|
||||
* @param txId the transaction Id
|
||||
* @param roomId the room id
|
||||
* @param eventId the event to delete
|
||||
* @param reason json containing reason key {"reason": "Indecent material"}
|
||||
*/
|
||||
@PUT(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/redact/{eventId}/{txnId}")
|
||||
suspend fun redactEvent(
|
||||
|
@ -332,9 +332,9 @@ internal interface RoomAPI {
|
|||
/**
|
||||
* Reports an event as inappropriate to the server, which may then notify the appropriate people.
|
||||
*
|
||||
* @param roomId the room id
|
||||
* @param roomId the room id
|
||||
* @param eventId the event to report content
|
||||
* @param body body containing score and reason
|
||||
* @param body body containing score and reason
|
||||
*/
|
||||
@POST(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/report/{eventId}")
|
||||
suspend fun reportContent(@Path("roomId") roomId: String,
|
||||
|
|
|
@ -62,7 +62,7 @@ internal class CryptoSyncHandler @Inject constructor(private val cryptoService:
|
|||
/**
|
||||
* Decrypt an encrypted event.
|
||||
*
|
||||
* @param event the event to decrypt
|
||||
* @param event the event to decrypt
|
||||
* @param timelineId the timeline identifier
|
||||
* @return true if the event has been decrypted
|
||||
*/
|
||||
|
|
|
@ -27,7 +27,7 @@ internal interface AccountDataAPI {
|
|||
* Set some account_data for the client.
|
||||
*
|
||||
* @param userId the user id
|
||||
* @param type the type
|
||||
* @param type the type
|
||||
* @param params the put params
|
||||
*/
|
||||
@PUT(NetworkConstants.URI_API_PREFIX_PATH_R0 + "user/{userId}/account_data/{type}")
|
||||
|
|
|
@ -95,7 +95,7 @@ internal class DefaultWidgetPostAPIMediator @Inject constructor(private val mosh
|
|||
/**
|
||||
* Send a boolean response.
|
||||
*
|
||||
* @param response the response
|
||||
* @param response the response
|
||||
* @param eventData the modular data
|
||||
*/
|
||||
override fun sendBoolResponse(response: Boolean, eventData: JsonDict) {
|
||||
|
@ -106,7 +106,7 @@ internal class DefaultWidgetPostAPIMediator @Inject constructor(private val mosh
|
|||
/**
|
||||
* Send an integer response.
|
||||
*
|
||||
* @param response the response
|
||||
* @param response the response
|
||||
* @param eventData the modular data
|
||||
*/
|
||||
override fun sendIntegerResponse(response: Int, eventData: JsonDict) {
|
||||
|
@ -116,9 +116,9 @@ internal class DefaultWidgetPostAPIMediator @Inject constructor(private val mosh
|
|||
/**
|
||||
* Send an object response.
|
||||
*
|
||||
* @param T the Json type
|
||||
* @param type the type
|
||||
* @param response the response
|
||||
* @param T the Json type
|
||||
* @param type the type
|
||||
* @param response the response
|
||||
* @param eventData the modular data
|
||||
*/
|
||||
override fun <T> sendObjectResponse(type: Type, response: T?, eventData: JsonDict) {
|
||||
|
@ -147,7 +147,7 @@ internal class DefaultWidgetPostAPIMediator @Inject constructor(private val mosh
|
|||
/**
|
||||
* Send an error.
|
||||
*
|
||||
* @param message the error message
|
||||
* @param message the error message
|
||||
* @param eventData the modular data
|
||||
*/
|
||||
override fun sendError(message: String, eventData: JsonDict) {
|
||||
|
@ -164,7 +164,7 @@ internal class DefaultWidgetPostAPIMediator @Inject constructor(private val mosh
|
|||
/**
|
||||
* Send the response to the javascript.
|
||||
*
|
||||
* @param jsString the response data
|
||||
* @param jsString the response data
|
||||
* @param eventData the modular data
|
||||
*/
|
||||
private fun sendResponse(jsString: String, eventData: JsonDict) = uiHandler.post {
|
||||
|
|
|
@ -54,7 +54,7 @@ internal fun convertFromUTF8(s: String): String {
|
|||
/**
|
||||
* Returns whether a string contains an occurrence of another, as a standalone word, regardless of case.
|
||||
*
|
||||
* @param subString the string to search for
|
||||
* @param subString the string to search for
|
||||
* @return whether a match was found
|
||||
*/
|
||||
internal fun String.caseInsensitiveFind(subString: String): Boolean {
|
||||
|
|
|
@ -46,7 +46,7 @@ object FcmHelper {
|
|||
* Store FCM token to the SharedPrefs
|
||||
*
|
||||
* @param context android context
|
||||
* @param token the token to store
|
||||
* @param token the token to store
|
||||
*/
|
||||
fun storeFcmToken(context: Context, token: String?) {
|
||||
// No op
|
||||
|
|
|
@ -53,7 +53,7 @@ object FcmHelper {
|
|||
* TODO Store in realm
|
||||
*
|
||||
* @param context android context
|
||||
* @param token the token to store
|
||||
* @param token the token to store
|
||||
*/
|
||||
fun storeFcmToken(context: Context,
|
||||
token: String?) {
|
||||
|
|
|
@ -41,7 +41,7 @@ class UnrecognizedCertificateDialog @Inject constructor(
|
|||
*
|
||||
* @param activity the Android activity
|
||||
* @param unrecognizedFingerprint the fingerprint for the unknown certificate
|
||||
* @param callback callback to fire when the user makes a decision
|
||||
* @param callback callback to fire when the user makes a decision
|
||||
*/
|
||||
fun show(activity: Activity,
|
||||
unrecognizedFingerprint: Fingerprint,
|
||||
|
@ -83,8 +83,8 @@ class UnrecognizedCertificateDialog @Inject constructor(
|
|||
*
|
||||
* @param activity the Activity
|
||||
* @param unrecognizedFingerprint the fingerprint for the unknown certificate
|
||||
* @param existing the current session already exist, so it mean that something has changed server side
|
||||
* @param callback callback to fire when the user makes a decision
|
||||
* @param existing the current session already exist, so it mean that something has changed server side
|
||||
* @param callback callback to fire when the user makes a decision
|
||||
* @param userId the matrix userId
|
||||
* @param homeServerUrl the homeserver url
|
||||
* @param homeServerConnectionConfigHasFingerprints true if the homeServerConnectionConfig has fingerprint
|
||||
|
|
|
@ -29,9 +29,9 @@ sealed class ExternalIntentData {
|
|||
/**
|
||||
* Constructor for a text message.
|
||||
*
|
||||
* @property text the text
|
||||
* @property text the text
|
||||
* @property htmlText the HTML text
|
||||
* @property format the formatted text format
|
||||
* @property format the formatted text format
|
||||
* @property clipDataItem the ClipData
|
||||
* @property mimeType the mimetype
|
||||
*/
|
||||
|
@ -54,7 +54,7 @@ sealed class ExternalIntentData {
|
|||
/**
|
||||
* Constructor from a media Uri/.
|
||||
*
|
||||
* @property uri the media uri
|
||||
* @property uri the media uri
|
||||
* @property filename the media file name
|
||||
*/
|
||||
data class IntentDataUri(
|
||||
|
|
|
@ -56,8 +56,8 @@ data class Resource(
|
|||
/**
|
||||
* Get a resource stream and metadata about it given its URI returned from onActivityResult.
|
||||
*
|
||||
* @param context the context.
|
||||
* @param uri the URI
|
||||
* @param context the context.
|
||||
* @param uri the URI
|
||||
* @param providedMimetype the mimetype
|
||||
* @return a [Resource] encapsulating the opened resource stream and associated metadata
|
||||
* or `null` if opening the resource stream failed.
|
||||
|
|
|
@ -30,7 +30,7 @@ import me.gujun.android.span.span
|
|||
/**
|
||||
* Open a web view above the current activity.
|
||||
*
|
||||
* @param url the url to open
|
||||
* @param url the url to open
|
||||
*/
|
||||
fun Context.displayInWebView(url: String) {
|
||||
val wv = WebView(this)
|
||||
|
|
|
@ -26,9 +26,9 @@ class EvenBetterLinkMovementMethod(private val onLinkClickListener: OnLinkClickL
|
|||
|
||||
interface OnLinkClickListener {
|
||||
/**
|
||||
* @param textView The TextView on which a click was registered.
|
||||
* @param span The ClickableSpan which is clicked on.
|
||||
* @param url The clicked URL.
|
||||
* @param textView The TextView on which a click was registered.
|
||||
* @param span The ClickableSpan which is clicked on.
|
||||
* @param url The clicked URL.
|
||||
* @param actualText The original text which is spanned. Can be used to compare actualText and target url to prevent misleading urls.
|
||||
* @return true if this click was handled, false to let Android handle the URL.
|
||||
*/
|
||||
|
|
|
@ -170,9 +170,9 @@ fun openUri(activity: Activity, uri: String) {
|
|||
/**
|
||||
* Send media to a third party application.
|
||||
*
|
||||
* @param activity the activity
|
||||
* @param activity the activity
|
||||
* @param savedMediaPath the media path
|
||||
* @param mimeType the media mime type.
|
||||
* @param mimeType the media mime type.
|
||||
*/
|
||||
fun openMedia(activity: Activity, savedMediaPath: String, mimeType: String) {
|
||||
val file = File(savedMediaPath)
|
||||
|
@ -415,8 +415,8 @@ fun selectTxtFileToWrite(
|
|||
*
|
||||
* ~~ This is copied from the old matrix sdk ~~
|
||||
*
|
||||
* @param sourceFile the file source path
|
||||
* @param dstDirPath the dst path
|
||||
* @param sourceFile the file source path
|
||||
* @param dstDirPath the dst path
|
||||
* @param outputFilename optional the output filename
|
||||
* @param currentTimeMillis the current time in milliseconds
|
||||
* @return the created file
|
||||
|
|
|
@ -101,9 +101,9 @@ private fun onPermissionResult(result: Map<String, Boolean>, lambda: (allGranted
|
|||
* explain why vector needs the corresponding permission.
|
||||
*
|
||||
* @param permissionsToBeGranted the permissions to be granted
|
||||
* @param activity the calling Activity that is requesting the permissions (or fragment parent)
|
||||
* @param activity the calling Activity that is requesting the permissions (or fragment parent)
|
||||
* @param activityResultLauncher from the calling fragment/Activity that is requesting the permissions
|
||||
* @param rationaleMessage message to be displayed BEFORE requesting for the permission
|
||||
* @param rationaleMessage message to be displayed BEFORE requesting for the permission
|
||||
* @return true if the permissions are granted (synchronous flow), false otherwise (asynchronous flow)
|
||||
*/
|
||||
fun checkPermissions(permissionsToBeGranted: List<String>,
|
||||
|
@ -145,7 +145,7 @@ fun checkPermissions(permissionsToBeGranted: List<String>,
|
|||
* To be call after the permission request.
|
||||
*
|
||||
* @param permissionsToBeGranted the permissions to be granted
|
||||
* @param activity the calling Activity that is requesting the permissions (or fragment parent)
|
||||
* @param activity the calling Activity that is requesting the permissions (or fragment parent)
|
||||
*
|
||||
* @return true if one of the permission has been denied and the user check the do not ask again checkbox
|
||||
*/
|
||||
|
|
|
@ -82,7 +82,7 @@ fun requestDisablingBatteryOptimization(activity: Activity, activityResultLaunch
|
|||
* Copy a text to the clipboard, and display a Toast when done.
|
||||
*
|
||||
* @param context the context
|
||||
* @param text the text to copy
|
||||
* @param text the text to copy
|
||||
* @param showToast true to also show a Toast to the user
|
||||
* @param toastMessage content of the toast message as a String resource
|
||||
*/
|
||||
|
|
|
@ -30,7 +30,7 @@ class CommandParser @Inject constructor() {
|
|||
/**
|
||||
* Convert the text message into a Slash command.
|
||||
*
|
||||
* @param textMessage the text message
|
||||
* @param textMessage the text message
|
||||
* @param isInThreadTimeline true if the user is currently typing in a thread
|
||||
* @return a parsed slash command (ok or error)
|
||||
*/
|
||||
|
|
|
@ -136,7 +136,7 @@ class VectorActivityLifecycleCallbacks constructor(private val popupAlertManager
|
|||
* Detect potential malicious activity.
|
||||
* Check if the activity running in app task is declared in app manifest.
|
||||
*
|
||||
* @param activity the activity of the task
|
||||
* @param activity the activity of the task
|
||||
* @return true if the activity is potentially malicious
|
||||
*/
|
||||
private fun isPotentialMaliciousActivity(activity: ComponentName): Boolean = activitiesInfo.none { it.name == activity.className }
|
||||
|
|
|
@ -156,16 +156,16 @@ class BugReporter @Inject constructor(
|
|||
/**
|
||||
* Send a bug report.
|
||||
*
|
||||
* @param reportType The report type (bug, suggestion, feedback)
|
||||
* @param withDevicesLogs true to include the device log
|
||||
* @param withCrashLogs true to include the crash logs
|
||||
* @param reportType The report type (bug, suggestion, feedback)
|
||||
* @param withDevicesLogs true to include the device log
|
||||
* @param withCrashLogs true to include the crash logs
|
||||
* @param withKeyRequestHistory true to include the crash logs
|
||||
* @param withScreenshot true to include the screenshot
|
||||
* @param withScreenshot true to include the screenshot
|
||||
* @param theBugDescription the bug description
|
||||
* @param serverVersion version of the server
|
||||
* @param canContact true if the user opt in to be contacted directly
|
||||
* @param customFields fields which will be sent with the report
|
||||
* @param listener the listener
|
||||
* @param serverVersion version of the server
|
||||
* @param canContact true if the user opt in to be contacted directly
|
||||
* @param customFields fields which will be sent with the report
|
||||
* @param listener the listener
|
||||
*/
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
fun sendBugReport(reportType: ReportType,
|
||||
|
@ -682,7 +682,7 @@ class BugReporter @Inject constructor(
|
|||
/**
|
||||
* Retrieves the logs.
|
||||
*
|
||||
* @param streamWriter the stream writer
|
||||
* @param streamWriter the stream writer
|
||||
* @param isErrorLogCat true to save the error logs
|
||||
*/
|
||||
private fun getLogCatError(streamWriter: OutputStreamWriter, isErrorLogCat: Boolean) {
|
||||
|
|
|
@ -39,7 +39,7 @@ public class BugReporterMultipartBody extends RequestBody {
|
|||
/**
|
||||
* Upload listener
|
||||
*
|
||||
* @param totalWritten total written bytes
|
||||
* @param totalWritten total written bytes
|
||||
* @param contentLength content length
|
||||
*/
|
||||
void onWrite(long totalWritten, long contentLength);
|
||||
|
@ -296,4 +296,4 @@ public class BugReporterMultipartBody extends RequestBody {
|
|||
return new BugReporterMultipartBody(boundary, parts);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ class VectorUncaughtExceptionHandler @Inject constructor(
|
|||
/**
|
||||
* An uncaught exception has been triggered.
|
||||
*
|
||||
* @param thread the thread
|
||||
* @param thread the thread
|
||||
* @param throwable the throwable
|
||||
* @return the exception description
|
||||
*/
|
||||
|
|
|
@ -120,8 +120,8 @@ object VectorLocale {
|
|||
/**
|
||||
* Get String from a locale.
|
||||
*
|
||||
* @param context the context
|
||||
* @param locale the locale
|
||||
* @param context the context
|
||||
* @param locale the locale
|
||||
* @param resourceId the string resource id
|
||||
* @return the localized string
|
||||
*/
|
||||
|
|
|
@ -493,7 +493,7 @@ class VectorPreferences @Inject constructor(
|
|||
/**
|
||||
* Update the notification ringtone.
|
||||
*
|
||||
* @param uri the new notification ringtone, or null for no RingTone
|
||||
* @param uri the new notification ringtone, or null for no RingTone
|
||||
*/
|
||||
fun setNotificationRingTone(uri: Uri?) {
|
||||
defaultPrefs.edit {
|
||||
|
@ -636,7 +636,7 @@ class VectorPreferences @Inject constructor(
|
|||
/**
|
||||
* Tells if the application is started on boot.
|
||||
*
|
||||
* @param value true to start the application on boot
|
||||
* @param value true to start the application on boot
|
||||
*/
|
||||
fun setAutoStartOnBoot(value: Boolean) {
|
||||
defaultPrefs.edit {
|
||||
|
@ -656,7 +656,7 @@ class VectorPreferences @Inject constructor(
|
|||
/**
|
||||
* Updates the selected saving period.
|
||||
*
|
||||
* @param index the selected period index
|
||||
* @param index the selected period index
|
||||
*/
|
||||
fun setSelectedMediasSavingPeriod(index: Int) {
|
||||
defaultPrefs.edit {
|
||||
|
|
|
@ -146,7 +146,7 @@ object ThemeUtils {
|
|||
/**
|
||||
* Translates color attributes to colors.
|
||||
*
|
||||
* @param c Context
|
||||
* @param c Context
|
||||
* @param colorAttribute Color Attribute
|
||||
* @return Requested Color
|
||||
*/
|
||||
|
@ -178,8 +178,8 @@ object ThemeUtils {
|
|||
/**
|
||||
* Tint the drawable with a theme attribute.
|
||||
*
|
||||
* @param context the context
|
||||
* @param drawable the drawable to tint
|
||||
* @param context the context
|
||||
* @param drawable the drawable to tint
|
||||
* @param attribute the theme color
|
||||
* @return the tinted drawable
|
||||
*/
|
||||
|
@ -191,7 +191,7 @@ object ThemeUtils {
|
|||
* Tint the drawable with a color integer.
|
||||
*
|
||||
* @param drawable the drawable to tint
|
||||
* @param color the color
|
||||
* @param color the color
|
||||
* @return the tinted drawable
|
||||
*/
|
||||
fun tintDrawableWithColor(drawable: Drawable, @ColorInt color: Int): Drawable {
|
||||
|
|
|
@ -48,8 +48,8 @@ interface WebViewEventListener {
|
|||
/**
|
||||
* Triggered when an error occurred while loading a page.
|
||||
*
|
||||
* @param url The url that failed.
|
||||
* @param errorCode The error code.
|
||||
* @param url The url that failed.
|
||||
* @param errorCode The error code.
|
||||
* @param description The error description.
|
||||
*/
|
||||
fun onPageError(url: String, errorCode: Int, description: String) {
|
||||
|
@ -59,8 +59,8 @@ interface WebViewEventListener {
|
|||
/**
|
||||
* Triggered when an error occurred while loading a page.
|
||||
*
|
||||
* @param url The url that failed.
|
||||
* @param errorCode The error code.
|
||||
* @param url The url that failed.
|
||||
* @param errorCode The error code.
|
||||
* @param description The error description.
|
||||
*/
|
||||
fun onHttpError(url: String, errorCode: Int, description: String) {
|
||||
|
|
Loading…
Reference in a new issue