Skip to content

Commit

Permalink
Merge pull request #6084 from vector-im/feature/bma/detekt_outdated_doc
Browse files Browse the repository at this point in the history
Feature/bma/detekt outdated doc
  • Loading branch information
bmarty authored May 20, 2022
2 parents 99b3ec6 + f5d0663 commit 4094a66
Show file tree
Hide file tree
Showing 115 changed files with 425 additions and 308 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 ->
Expand All @@ -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> {
Expand Down Expand Up @@ -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(
Expand All @@ -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,
Expand All @@ -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
*/
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ 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?

/**
* 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
*/
Expand All @@ -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?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface ContentScannerService {

/**
* Get the current public curve25519 key that the AV server is advertising.
* @param callback on success callback containing the server public key
* @param forceDownload true to force the SDK to download again the server public key
*/
suspend fun getServerPublicKey(forceDownload: Boolean = false): String?
suspend fun getScanResultForAttachment(mxcUrl: String, fileInfo: ElementToDecrypt? = null): ScanStatusInfo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ data class IncomingRoomKeyRequest(
/**
* Factory.
*
* @param event the event
* @param currentTimeMillis the current time in milliseconds
* @param trail the AuditTrail data
*/
fun fromEvent(trail: AuditTrail): IncomingRoomKeyRequest? {
return trail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class MXUsersDevicesMap<E> {
/**
* Provides the object for a device id and a user Id.
*
* @param userId the user id
* @param deviceId the device id
* @param userId the object id
* @return the object
*/
fun getObject(userId: String?, deviceId: String?): E? {
Expand All @@ -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) {
Expand All @@ -73,8 +73,8 @@ class MXUsersDevicesMap<E> {
/**
* Defines the objects map for a user Id.
*
* @param userId the user id
* @param objectsPerDevices the objects maps
* @param userId the user id
*/
fun setObjects(userId: String?, objectsPerDevices: Map<String, E>?) {
if (!userId.isNullOrBlank()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface FileService {
/**
* The original file is in cache, but the decrypted files can be deleted for security reason.
* To decrypt the file again, call [downloadFile], the encrypted file will not be downloaded again
* @param decryptedFileInCache true if the decrypted file is available. Always true for clear files.
* @property decryptedFileInCache true if the decrypted file is available. Always true for clear files.
*/
data class InCache(val decryptedFileInCache: Boolean) : FileState()
object Downloading : FileState()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ interface IdentityService {
/**
* Submit the code that the identity server has sent to the user (in email or SMS).
* Once successful, you will have to call [finalizeBindThreePid]
* @param threePid the three pid
* @param code the code sent to the user
*/
suspend fun submitValidationToken(threePid: ThreePid, code: String)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ interface IntegrationManagerService {
* Offers to allow or disallow a native widget domain.
* @param widgetType the widget type to check for
* @param domain the domain to check for
* @param allowed true or false
*/
suspend fun setNativeWidgetDomainAllowed(widgetType: String, domain: String, allowed: Boolean)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ object MatrixLinkify {
* Find the matrix spans i.e matrix id , user id ... to display them as URL.
*
* @param spannable the text in which the matrix items has to be clickable.
* @param callback listener to be notified when the span is clicked
*/
@Suppress("UNUSED_PARAMETER")
fun addLinks(spannable: Spannable, callback: MatrixPermalinkSpan.Callback?): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import org.matrix.android.sdk.api.session.permalinks.MatrixPermalinkSpan.Callbac

/**
* This MatrixPermalinkSpan is a clickable span which use a [Callback] to communicate back.
* @param url the permalink url tied to the span
* @param callback the callback to use.
* @property url the permalink url tied to the span
* @property callback the callback to use.
*/
class MatrixPermalinkSpan(private val url: String,
private val callback: Callback? = null) : ClickableSpan() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ interface PermalinkService {
* Creates a permalink for a roomId, including the via parameters.
*
* @param roomId the room id
* @param viaServers the via parameter
* @param forceMatrixTo whether we should force using matrix.to base URL
*
* @return the permalink, or null in case of error
Expand All @@ -70,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
*
Expand All @@ -90,7 +91,7 @@ interface PermalinkService {
* Creates a HTML or Markdown mention span template. Can be used to replace a mention with a permalink to mentioned user.
* Ex: "<a href=\"https://matrix.to/#/%1\$s\">%2\$s</a>" or "[%2\$s](https://matrix.to/#/%1\$s)"
*
* @param type: type of template to create
* @param type type of template to create
* @param forceMatrixTo whether we should force using matrix.to base URL
*
* @return the created template
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ interface PushRuleService {

/**
* Enables/Disables a push rule and updates the actions if necessary.
* @param kind the rule kind
* @param ruleId the rule id
* @param enable Enables/Disables the rule
* @param actions Actions to update if not null
*/

suspend fun updatePushRuleActions(kind: RuleKind, ruleId: String, enable: Boolean, actions: List<Action>?)

suspend fun removePushRule(kind: RuleKind, ruleId: String)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ interface RoomCryptoService {

/**
* Enable encryption of the room.
* @param Use force to ensure that this algorithm will be used. Otherwise this call
* @param algorithm the algorithm to set, default to [MXCRYPTO_ALGORITHM_MEGOLM]
* @param force Use force to ensure that this algorithm will be used. Otherwise this call
* will throw if encryption is already setup or if the algorithm is not supported. Only to
* be used by admins to fix misconfigured encryption.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ interface RelationService {

/**
* Edit a poll.
* @param pollType indicates open or closed polls
* @param targetEvent The poll event to edit
* @param pollType indicates open or closed polls
* @param question The edited question
* @param options The edited options
*/
Expand All @@ -84,7 +84,9 @@ interface RelationService {
/**
* Edit a text message body. Limited to "m.text" contentType.
* @param targetEvent The event to edit
* @param msgType the message type
* @param newBodyText The edited body
* @param newBodyAutoMarkdown true to parse markdown on the new body
* @param compatibilityBodyText The text that will appear on clients that don't support yet edition
*/
fun editTextMessage(targetEvent: TimelineEvent,
Expand Down Expand Up @@ -153,8 +155,8 @@ interface RelationService {
* @param rootThreadEventId the root thread eventId
* @param replyInThreadText the reply text
* @param msgType the message type: MessageType.MSGTYPE_TEXT (default) or MessageType.MSGTYPE_EMOTE
* @param formattedText The formatted body using MessageType#FORMAT_MATRIX_HTML
* @param autoMarkdown If true, the SDK will generate a formatted HTML message from the body text if markdown syntax is present
* @param formattedText The formatted body using MessageType#FORMAT_MATRIX_HTML
* @param eventReplied the event referenced by the reply within a thread
*/
fun replyInThread(rootThreadEventId: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ interface ReadService {

/**
* Returns a live list of read receipts for a given event.
* @param eventId: the event
* @param eventId the event
*/
fun getEventReadReceiptsLive(eventId: String): LiveData<List<ReadReceipt>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ interface SendService {
* @param quotedEvent The event to which we will quote it's content.
* @param text the text message to send
* @param autoMarkdown If true, the SDK will generate a formatted HTML message from the body text if markdown syntax is present
* @param rootThreadEventId when this param is not null, the message will be sent in this specific thread
* @return a [Cancelable]
*/
fun sendQuotedTextMessage(quotedEvent: TimelineEvent, text: String, autoMarkdown: Boolean, rootThreadEventId: String? = null): Cancelable
Expand Down
Loading

0 comments on commit 4094a66

Please sign in to comment.