Skip to content

Commit

Permalink
Merge pull request #6064 from vector-im/feature/bma/detekt_end_period
Browse files Browse the repository at this point in the history
Detekt: fix end period
  • Loading branch information
bmarty authored May 16, 2022
2 parents 955f366 + 12eb23b commit 3674ae7
Show file tree
Hide file tree
Showing 718 changed files with 1,680 additions and 1,673 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package im.vector.lib.core.utils.epoxy.charsequence

/**
* Wrapper for a CharSequence, which support mutation of the CharSequence, which can happen during rendering
* Wrapper for a CharSequence, which support mutation of the CharSequence, which can happen during rendering.
*/
class EpoxyCharSequence(val charSequence: CharSequence) {
private val hash = charSequence.toString().hashCode()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
package im.vector.lib.core.utils.epoxy.charsequence

/**
* Extensions to wrap CharSequence to EpoxyCharSequence
* Extensions to wrap CharSequence to EpoxyCharSequence.
*/
fun CharSequence.toEpoxyCharSequence() = EpoxyCharSequence(this)
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import im.vector.lib.multipicker.entity.MultiPickerAudioType
import im.vector.lib.multipicker.utils.toMultiPickerAudioType

/**
* Audio file picker implementation
* Audio file picker implementation.
*/
class AudioPicker : Picker<MultiPickerAudioType>() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ import im.vector.lib.multipicker.utils.createTemporaryMediaFile
import im.vector.lib.multipicker.utils.toMultiPickerImageType

/**
* Implementation of taking a photo with Camera
* Implementation of taking a photo with Camera.
*/
class CameraPicker {

/**
* Start camera by using a ActivityResultLauncher
* Start camera by using a ActivityResultLauncher.
* @return Uri of taken photo or null if the operation is cancelled.
*/
fun startWithExpectingFile(context: Context, activityResultLauncher: ActivityResultLauncher<Intent>): Uri {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ import im.vector.lib.multipicker.utils.createTemporaryMediaFile
import im.vector.lib.multipicker.utils.toMultiPickerVideoType

/**
* Implementation of taking a video with Camera
* Implementation of taking a video with Camera.
*/
class CameraVideoPicker {

/**
* Start camera by using a ActivityResultLauncher
* Start camera by using a ActivityResultLauncher.
* @return Uri of taken photo or null if the operation is cancelled.
*/
fun startWithExpectingFile(context: Context, activityResultLauncher: ActivityResultLauncher<Intent>): Uri {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import im.vector.lib.multipicker.entity.MultiPickerContactType
import im.vector.lib.multipicker.utils.getColumnIndexOrNull

/**
* Contact Picker implementation
* Contact Picker implementation.
*/
class ContactPicker : Picker<MultiPickerContactType>() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import im.vector.lib.multipicker.utils.toMultiPickerImageType
import im.vector.lib.multipicker.utils.toMultiPickerVideoType

/**
* Implementation of selecting any type of files
* Implementation of selecting any type of files.
*/
class FilePicker : Picker<MultiPickerBaseType>() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import im.vector.lib.multipicker.entity.MultiPickerImageType
import im.vector.lib.multipicker.utils.toMultiPickerImageType

/**
* Image Picker implementation
* Image Picker implementation.
*/
class ImagePicker : Picker<MultiPickerImageType>() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import im.vector.lib.multipicker.utils.toMultiPickerImageType
import im.vector.lib.multipicker.utils.toMultiPickerVideoType

/**
* Image/Video Picker implementation
* Image/Video Picker implementation.
*/
class MediaPicker : Picker<MultiPickerBaseMediaType>() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import android.net.Uri
import androidx.activity.result.ActivityResultLauncher

/**
* Abstract class to provide all types of Pickers
* Abstract class to provide all types of Pickers.
*/
abstract class Picker<T> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import im.vector.lib.multipicker.entity.MultiPickerVideoType
import im.vector.lib.multipicker.utils.toMultiPickerVideoType

/**
* Video Picker implementation
* Video Picker implementation.
*/
class VideoPicker : Picker<MultiPickerVideoType>() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ package org.matrix.android.sdk.api
interface MatrixCallback<in T> {

/**
* On success method, default to no-op
* On success method, default to no-op.
* @param data the data successfully returned from the async function
*/
fun onSuccess(data: T) {
// no-op
}

/**
* On failure method, default to no-op
* On failure method, default to no-op.
* @param failure the failure data returned from the async function
*/
fun onFailure(failure: Throwable) {
Expand All @@ -40,6 +40,6 @@ interface MatrixCallback<in T> {
}

/**
* Basic no op implementation
* Basic no op implementation.
*/
class NoOpMatrixCallback<T> : MatrixCallback<T>
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ data class MatrixConfiguration(
*/
val proxy: Proxy? = null,
/**
* TLS versions and cipher suites limitation for unauthenticated requests
* TLS versions and cipher suites limitation for unauthenticated requests.
*/
val connectionSpec: ConnectionSpec = ConnectionSpec.RESTRICTED_TLS,
/**
Expand All @@ -62,7 +62,7 @@ data class MatrixConfiguration(
*/
val roomDisplayNameFallbackProvider: RoomDisplayNameFallbackProvider,
/**
* Thread messages default enable/disabled value
* Thread messages default enable/disabled value.
*/
val threadMessagesEnabledDefault: Boolean = false,
)
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package org.matrix.android.sdk.api

/**
* This object define some global constants regarding the Matrix specification
* This object define some global constants regarding the Matrix specification.
*/
object MatrixConstants {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ object MatrixPatterns {
}

/**
* Extract server name from a matrix id
* Extract server name from a matrix id.
*
* @param matrixId
* @return null if not found or if matrixId is null
Expand All @@ -172,7 +172,7 @@ object MatrixPatterns {
}

/**
* Return the domain form a userId
* Return the domain form a userId.
* Examples:
* - "@alice:domain.org".getDomain() will return "domain.org"
* - "@bob:domain.org:3455".getDomain() will return "domain.org:3455"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@
package org.matrix.android.sdk.api

/**
* This class contains pattern to match Matrix Url, aka mxc urls
* This class contains pattern to match Matrix Url, aka mxc urls.
*/
object MatrixUrls {
/**
* "mxc" scheme, including "://". So "mxc://"
* "mxc" scheme, including "://". So "mxc://".
*/
const val MATRIX_CONTENT_URI_SCHEME = "mxc://"

/**
* Return true if the String starts with "mxc://"
* Return true if the String starts with "mxc://".
*/
fun String.isMxcUrl() = startsWith(MATRIX_CONTENT_URI_SCHEME)

/**
* Remove the "mxc://" prefix. No op if the String is not a Mxc URL
* Remove the "mxc://" prefix. No op if the String is not a Mxc URL.
*/
fun String.removeMxcPrefix() = removePrefix(MATRIX_CONTENT_URI_SCHEME)
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ interface AuthenticationService {
suspend fun getLoginFlowOfSession(sessionId: String): LoginFlowResult

/**
* Get a SSO url
* Get a SSO url.
*/
fun getSsoUrl(redirectUrl: String, deviceId: String?, providerId: String?): String?

/**
* Get the sign in or sign up fallback URL
* Get the sign in or sign up fallback URL.
*/
fun getFallbackUrl(forSignIn: Boolean, deviceId: String?): String?

Expand All @@ -64,17 +64,17 @@ interface AuthenticationService {
fun getRegistrationWizard(): RegistrationWizard

/**
* True when login and password has been sent with success to the homeserver
* True when login and password has been sent with success to the homeserver.
*/
val isRegistrationStarted: Boolean

/**
* Cancel pending login or pending registration
* Cancel pending login or pending registration.
*/
suspend fun cancelPendingLoginOrRegistration()

/**
* Reset all pending settings, including current HomeServerConnectionConfig
* Reset all pending settings, including current HomeServerConnectionConfig.
*/
suspend fun reset()

Expand All @@ -91,20 +91,20 @@ interface AuthenticationService {
fun getLastAuthenticatedSession(): Session?

/**
* Create a session after a SSO successful login
* Create a session after a SSO successful login.
*/
suspend fun createSessionFromSso(homeServerConnectionConfig: HomeServerConnectionConfig,
credentials: Credentials): Session

/**
* Perform a wellknown request, using the domain from the matrixId
* Perform a wellknown request, using the domain from the matrixId.
*/
suspend fun getWellKnownData(matrixId: String,
homeServerConnectionConfig: HomeServerConnectionConfig?): WellknownResult

/**
* Authenticate with a matrixId and a password
* Usually call this after a successful call to getWellKnownData()
* Authenticate with a matrixId and a password.
* Usually call this after a successful call to getWellKnownData().
* @param homeServerConnectionConfig the information about the homeserver and other configuration
* @param matrixId the matrixId of the user
* @param password the password of the account
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import com.squareup.moshi.JsonClass
import org.matrix.android.sdk.api.auth.data.LoginFlowTypes

/**
* This class provides the authentication data by using user and password
* This class provides the authentication data by using user and password.
*/
@JsonClass(generateAdapter = true)
data class TokenBasedAuth(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import com.squareup.moshi.JsonClass
import org.matrix.android.sdk.api.auth.data.LoginFlowTypes

/**
* This class provides the authentication data by using user and password
* This class provides the authentication data by using user and password.
*/
@JsonClass(generateAdapter = true)
data class UserPasswordAuth(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ data class Credentials(
*/
@Json(name = "access_token") val accessToken: String,
/**
* Not documented
* Not documented.
*/
@Json(name = "refresh_token") val refreshToken: String?,
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ package org.matrix.android.sdk.api.auth.data
*/
data class SessionParams(
/**
* Please consider using shortcuts instead
* Please consider using shortcuts instead.
*/
val credentials: Credentials,

/**
* Please consider using shortcuts instead
* Please consider using shortcuts instead.
*/
val homeServerConnectionConfig: HomeServerConnectionConfig,

Expand All @@ -41,12 +41,12 @@ data class SessionParams(
*/

/**
* The userId of the session (Ex: "@user:domain.org")
* The userId of the session (Ex: "@user:domain.org").
*/
val userId = credentials.userId

/**
* The deviceId of the session (Ex: "ABCDEFGH")
* The deviceId of the session (Ex: "ABCDEFGH").
*/
val deviceId = credentials.deviceId

Expand All @@ -62,12 +62,12 @@ data class SessionParams(
val homeServerUrlBase = homeServerConnectionConfig.homeServerUriBase.toString()

/**
* The current homeserver host, using what has been entered by the user during login phase
* The current homeserver host, using what has been entered by the user during login phase.
*/
val homeServerHost = homeServerConnectionConfig.homeServerUri.host

/**
* The default identity server url if any, returned by the homeserver during login phase
* The default identity server url if any, returned by the homeserver during login phase.
*/
val defaultIdentityServerUrl = homeServerConnectionConfig.identityServerUri?.toString()
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import org.matrix.android.sdk.api.util.JsonDict
* }
* }
* </pre>
* .
*/
@JsonClass(generateAdapter = true)
data class WellKnown(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import com.squareup.moshi.JsonClass
* "base_url": "https://vector.im"
* }
* </pre>
* .
*/
@JsonClass(generateAdapter = true)
data class WellKnownBaseConfig(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import org.matrix.android.sdk.api.util.JsonDict
*/
interface LoginWizard {
/**
* Get some information about a matrixId: displayName and avatar url
* Get some information about a matrixId: displayName and avatar url.
*/
suspend fun getProfileInfo(matrixId: String): LoginProfileInfo

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ data class RegistrationFlowResponse(
)

/**
* Convert to something easier to handle on client side
* Convert to something easier to handle on client side.
*/
fun RegistrationFlowResponse.toFlowResult(): FlowResult {
// Get all the returned stages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const val MXCRYPTO_ALGORITHM_MEGOLM = "m.megolm.v1.aes-sha2"
const val MXCRYPTO_ALGORITHM_MEGOLM_BACKUP = "m.megolm_backup.v1.curve25519-aes-sha2"

/**
* Secured Shared Storage algorithm constant
* Secured Shared Storage algorithm constant.
*/
const val SSSS_ALGORITHM_CURVE25519_AES_SHA2 = "m.secret_storage.v1.curve25519-aes-sha2"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import org.matrix.android.sdk.api.session.crypto.verification.EmojiRepresentatio
import org.matrix.android.sdk.internal.crypto.verification.getEmojiForCode

/**
* Provide all the emojis used for SAS verification (for debug purpose)
* Provide all the emojis used for SAS verification (for debug purpose).
*/
fun getAllVerificationEmojis(): List<EmojiRepresentation> {
return (0..63).map { getEmojiForCode(it) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ fun CharSequence.ensurePrefix(prefix: CharSequence): CharSequence {
}

/**
* Append a new line and then the provided string
* Append a new line and then the provided string.
*/
fun StringBuilder.appendNl(str: String) = append("\n").append(str)
Loading

0 comments on commit 3674ae7

Please sign in to comment.