mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-25 10:55:55 +03:00
Detekt: Fix OutdatedDocumentation
This commit is contained in:
parent
2a66e03742
commit
51fe7b9a93
71 changed files with 179 additions and 64 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -46,8 +46,8 @@ class MXUsersDevicesMap<E> {
|
|||
/**
|
||||
* Provides the object for a device id and a user Id.
|
||||
*
|
||||
* @param deviceId the device id
|
||||
* @param userId the object id
|
||||
* @param deviceId the device id
|
||||
* @return the object
|
||||
*/
|
||||
fun getObject(userId: String?, deviceId: String?): E? {
|
||||
|
@ -73,8 +73,8 @@ class MXUsersDevicesMap<E> {
|
|||
/**
|
||||
* Defines the objects map for a user Id.
|
||||
*
|
||||
* @param objectsPerDevices the objects maps
|
||||
* @param userId the user id
|
||||
* @param objectsPerDevices the objects maps
|
||||
*/
|
||||
fun setObjects(userId: String?, objectsPerDevices: Map<String, E>?) {
|
||||
if (!userId.isNullOrBlank()) {
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -90,23 +90,29 @@ interface StateService {
|
|||
|
||||
/**
|
||||
* Get a state event of the room.
|
||||
* @param eventType An eventType.
|
||||
* @param stateKey the query which will be done on the stateKey
|
||||
*/
|
||||
fun getStateEvent(eventType: String, stateKey: QueryStringValue = QueryStringValue.NoCondition): Event?
|
||||
|
||||
/**
|
||||
* Get a live state event of the room.
|
||||
* @param eventType An eventType.
|
||||
* @param stateKey the query which will be done on the stateKey
|
||||
*/
|
||||
fun getStateEventLive(eventType: String, stateKey: QueryStringValue = QueryStringValue.NoCondition): LiveData<Optional<Event>>
|
||||
|
||||
/**
|
||||
* Get state events of the room.
|
||||
* @param eventTypes Set of eventType. If empty, all state events will be returned
|
||||
* @param stateKey the query which will be done on the stateKey
|
||||
*/
|
||||
fun getStateEvents(eventTypes: Set<String>, stateKey: QueryStringValue = QueryStringValue.NoCondition): List<Event>
|
||||
|
||||
/**
|
||||
* Get live state events of the room.
|
||||
* @param eventTypes Set of eventType to observe. If empty, all state events will be observed
|
||||
* @param stateKey the query which will be done on the stateKey
|
||||
*/
|
||||
fun getStateEventsLive(eventTypes: Set<String>, stateKey: QueryStringValue = QueryStringValue.NoCondition): LiveData<List<Event>>
|
||||
|
||||
|
|
|
@ -90,6 +90,7 @@ data class TimelineEvent(
|
|||
|
||||
/**
|
||||
* Get the metadata associated with a key.
|
||||
* @param T type to cast the metadata to
|
||||
* @param key the key to get the metadata
|
||||
* @return the metadata
|
||||
*/
|
||||
|
|
|
@ -92,7 +92,7 @@ interface SharedSecretStorageService {
|
|||
* Clients MUST ensure that the key is trusted before using it to encrypt secrets.
|
||||
*
|
||||
* @param name The name of the secret
|
||||
* @param secret The secret contents.
|
||||
* @param secretBase64 The secret contents.
|
||||
* @param keys The list of (ID,privateKey) of the keys to use to encrypt the secret.
|
||||
*/
|
||||
suspend fun storeSecret(name: String, secretBase64: String, keys: List<KeyRef>)
|
||||
|
|
|
@ -44,8 +44,8 @@ interface SpaceService {
|
|||
roomAliasLocalPart: String? = null): String
|
||||
|
||||
/**
|
||||
* Get a space from a roomId.
|
||||
* @param spaceId the roomId to look for.
|
||||
* Get a space from a spaceId.
|
||||
* @param spaceId the spaceId to look for.
|
||||
* @return a space with spaceId or null if room type is not space
|
||||
*/
|
||||
fun getSpace(spaceId: String): Space?
|
||||
|
@ -54,21 +54,24 @@ interface SpaceService {
|
|||
* Try to resolve (peek) rooms and subspace in this space.
|
||||
* Use this call get preview of children of this space, particularly useful to get a
|
||||
* preview of rooms that you did not join yet.
|
||||
* @param spaceId the spaceId to look for.
|
||||
*/
|
||||
suspend fun peekSpace(spaceId: String): SpacePeekResult
|
||||
|
||||
/**
|
||||
* Get's information of a space by querying the server.
|
||||
*
|
||||
* @param spaceId the spaceId to look for.
|
||||
* @param suggestedOnly If true, return only child events and rooms where the m.space.child event has suggested: true.
|
||||
* @param limit a client-defined limit to the maximum number of rooms to return per page. Must be a non-negative integer.
|
||||
* @param from Optional. Pagination token given to retrieve the next set of rooms. Note that if a pagination token is provided,
|
||||
* then the parameters given for suggested_only and max_depth must be the same.
|
||||
* @param knownStateList when paginating, pass back the m.space.child state events
|
||||
*/
|
||||
suspend fun querySpaceChildren(spaceId: String,
|
||||
suggestedOnly: Boolean? = null,
|
||||
limit: Int? = null,
|
||||
from: String? = null,
|
||||
// when paginating, pass back the m.space.child state events
|
||||
knownStateList: List<Event>? = null): SpaceHierarchyData
|
||||
|
||||
/**
|
||||
|
@ -98,7 +101,10 @@ interface SpaceService {
|
|||
|
||||
/**
|
||||
* Let this room declare that it has a parent.
|
||||
* @param childRoomId the space to set as a child
|
||||
* @param parentSpaceId the parentId which will be set
|
||||
* @param canonical true if it should be the main parent of this room
|
||||
* @param viaServers list of candidate servers that can be used to set the parent
|
||||
* In practice, well behaved rooms should only have one canonical parent, but given this is not enforced:
|
||||
* if multiple are present the client should select the one with the lowest room ID, as determined via a lexicographic utf-8 ordering.
|
||||
*/
|
||||
|
|
|
@ -65,7 +65,8 @@ interface WidgetPostAPIMediator {
|
|||
/**
|
||||
* Send an object response.
|
||||
*
|
||||
* @param klass the class of the response
|
||||
* @param T the generic type
|
||||
* @param type the type of the response
|
||||
* @param response the response
|
||||
* @param eventData the modular data
|
||||
*/
|
||||
|
|
|
@ -46,6 +46,7 @@ internal class CryptoSessionInfoProvider @Inject constructor(
|
|||
}
|
||||
|
||||
/**
|
||||
* @param roomId the room Id
|
||||
* @param allActive if true return joined as well as invited, if false, only joined
|
||||
*/
|
||||
fun getRoomUserIds(roomId: String, allActive: Boolean): List<String> {
|
||||
|
|
|
@ -905,6 +905,7 @@ internal class DefaultCryptoService @Inject constructor(
|
|||
/**
|
||||
* Handle an m.room.encryption event.
|
||||
*
|
||||
* @param roomId the room Id
|
||||
* @param event the encryption event.
|
||||
*/
|
||||
private fun onRoomEncryptionEvent(roomId: String, event: Event) {
|
||||
|
@ -928,6 +929,7 @@ internal class DefaultCryptoService @Inject constructor(
|
|||
/**
|
||||
* Handle a change in the membership state of a member of a room.
|
||||
*
|
||||
* @param roomId the room Id
|
||||
* @param event the membership event causing the change
|
||||
*/
|
||||
private fun onRoomMembershipEvent(roomId: String, event: Event) {
|
||||
|
|
|
@ -140,7 +140,7 @@ internal object MXMegolmExportEncryption {
|
|||
*
|
||||
* @param data the data to encrypt.
|
||||
* @param password the password
|
||||
* @param kdf_rounds the iteration count
|
||||
* @param kdfRounds the iteration count
|
||||
* @return the encrypted data
|
||||
* @throws Exception the failure reason
|
||||
*/
|
||||
|
|
|
@ -429,8 +429,8 @@ internal class MXOlmDevice @Inject constructor(
|
|||
*
|
||||
* @param ciphertext the base64-encoded body from the received message.
|
||||
* @param messageType message_type field from the received message.
|
||||
* @param theirDeviceIdentityKey the Curve25519 identity key for the remote device.
|
||||
* @param sessionId the id of the active session.
|
||||
* @param theirDeviceIdentityKey the Curve25519 identity key for the remote device.
|
||||
* @return the decrypted payload.
|
||||
*/
|
||||
@kotlin.jvm.Throws
|
||||
|
@ -873,9 +873,9 @@ internal class MXOlmDevice @Inject constructor(
|
|||
* Extract an InboundGroupSession from the session store and do some check.
|
||||
* inboundGroupSessionWithIdError describes the failure reason.
|
||||
*
|
||||
* @param roomId the room where the session is used.
|
||||
* @param sessionId the session identifier.
|
||||
* @param senderKey the base64-encoded curve25519 key of the sender.
|
||||
* @param roomId the room where the session is used.
|
||||
* @return the inbound group session.
|
||||
*/
|
||||
fun getInboundGroupSession(sessionId: String?, senderKey: String?, roomId: String?): InboundGroupSessionHolder {
|
||||
|
|
|
@ -40,6 +40,7 @@ internal interface IMXDecrypting {
|
|||
* Handle a key event.
|
||||
*
|
||||
* @param event the key event.
|
||||
* @param defaultKeysBackupService the keys backup service
|
||||
*/
|
||||
fun onRoomKeyEvent(event: Event, defaultKeysBackupService: DefaultKeysBackupService) {}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ internal interface IMXGroupEncryption {
|
|||
* Re-shares a session key with devices if the key has already been
|
||||
* sent to them.
|
||||
*
|
||||
* @param sessionId The id of the outbound session to share.
|
||||
* @param groupSessionId The id of the outbound session to share.
|
||||
* @param userId The id of the user who owns the target device.
|
||||
* @param deviceId The id of the target device.
|
||||
* @param senderKey The key of the originating device for the session.
|
||||
|
|
|
@ -176,6 +176,7 @@ internal class MXMegolmDecryption(
|
|||
* Handle a key event.
|
||||
*
|
||||
* @param event the key event.
|
||||
* @param defaultKeysBackupService the keys backup service
|
||||
*/
|
||||
override fun onRoomKeyEvent(event: Event, defaultKeysBackupService: DefaultKeysBackupService) {
|
||||
Timber.tag(loggerTag.value).v("onRoomKeyEvent()")
|
||||
|
|
|
@ -180,8 +180,8 @@ internal class MXOlmDecryption(
|
|||
/**
|
||||
* Attempt to decrypt an Olm message.
|
||||
*
|
||||
* @param theirDeviceIdentityKey the Curve25519 identity key of the sender.
|
||||
* @param message message object, with 'type' and 'body' fields.
|
||||
* @param theirDeviceIdentityKey the Curve25519 identity key of the sender.
|
||||
* @return payload, if decrypted successfully.
|
||||
*/
|
||||
private suspend fun decryptMessage(message: JsonDict, theirDeviceIdentityKey: String): String? {
|
||||
|
|
|
@ -103,7 +103,7 @@ internal interface CryptoApi {
|
|||
* Claim one-time keys.
|
||||
* Doc: https://matrix.org/docs/spec/client_server/r0.4.0.html#post-matrix-client-r0-keys-claim
|
||||
*
|
||||
* @param params the params.
|
||||
* @param body the Json body.
|
||||
*/
|
||||
@POST(NetworkConstants.URI_API_PREFIX_PATH_R0 + "keys/claim")
|
||||
suspend fun claimOneTimeKeysForUsersDevices(@Body body: KeysClaimBody): KeysClaimResponse
|
||||
|
|
|
@ -159,6 +159,7 @@ internal object MXEncryptedAttachments {
|
|||
* Encrypt an attachment stream.
|
||||
* DO NOT USE for big files, it will load all in memory
|
||||
* @param attachmentStream the attachment stream. Will be closed after this method call.
|
||||
* @param clock a clock to retrieve current time
|
||||
* @return the encryption file info
|
||||
*/
|
||||
fun encryptAttachment(attachmentStream: InputStream, clock: Clock): EncryptionResult {
|
||||
|
@ -232,6 +233,7 @@ 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
|
||||
* @return true in case of success, false in case of error
|
||||
*/
|
||||
fun decryptAttachment(attachmentStream: InputStream?,
|
||||
|
|
|
@ -1105,6 +1105,7 @@ internal class DefaultKeysBackupService @Inject constructor(
|
|||
*
|
||||
* @param password the password.
|
||||
* @param keysBackupData the backup and its auth data.
|
||||
* @param progressListener listener to track progress
|
||||
*
|
||||
* @return the recovery key if successful, null in other cases
|
||||
*/
|
||||
|
|
|
@ -44,6 +44,7 @@ internal data class GeneratePrivateKeyResult(
|
|||
* Compute a private key from a password.
|
||||
*
|
||||
* @param password the password to use.
|
||||
* @param progressListener a listener to track progress
|
||||
*
|
||||
* @return a {privateKey, salt, iterations} tuple.
|
||||
*/
|
||||
|
|
|
@ -72,7 +72,7 @@ internal interface RoomKeysApi {
|
|||
*/
|
||||
@PUT(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "room_keys/version/{version}")
|
||||
suspend fun updateKeysBackupVersion(@Path("version") version: String,
|
||||
@Body keysBackupVersionBody: UpdateKeysBackupVersionBody)
|
||||
@Body updateKeysBackupVersionBody: UpdateKeysBackupVersionBody)
|
||||
|
||||
/* ==========================================================================================
|
||||
* Storing keys
|
||||
|
|
|
@ -164,16 +164,14 @@ internal interface IMXCryptoStore {
|
|||
|
||||
/**
|
||||
* Store the end to end account for the logged-in user.
|
||||
*
|
||||
* @param account the account to save
|
||||
*/
|
||||
fun saveOlmAccount()
|
||||
|
||||
/**
|
||||
* Retrieve a device for a user.
|
||||
*
|
||||
* @param deviceId the device id.
|
||||
* @param userId the user's id.
|
||||
* @param deviceId the device id.
|
||||
* @return the device
|
||||
*/
|
||||
fun getUserDevice(userId: String, deviceId: String): CryptoDeviceInfo?
|
||||
|
@ -331,7 +329,7 @@ internal interface IMXCryptoStore {
|
|||
/**
|
||||
* Mark inbound group sessions as backed up on the user homeserver.
|
||||
*
|
||||
* @param sessions the sessions
|
||||
* @param olmInboundGroupSessionWrappers the sessions
|
||||
*/
|
||||
fun markBackupDoneForInboundGroupSessions(olmInboundGroupSessionWrappers: List<OlmInboundGroupSessionWrapper2>)
|
||||
|
||||
|
@ -380,7 +378,9 @@ internal interface IMXCryptoStore {
|
|||
/**
|
||||
* Look for an existing outgoing room key request, and if none is found, add a new one.
|
||||
*
|
||||
* @param request the request
|
||||
* @param requestBody the request
|
||||
* @param recipients list of recipients
|
||||
* @param fromIndex start index
|
||||
* @return either the same instance as passed in, or the existing one.
|
||||
*/
|
||||
fun getOrAddOutgoingRoomKeyRequest(requestBody: RoomKeyRequestBody, recipients: Map<String, List<String>>, fromIndex: Int): OutgoingKeyRequest
|
||||
|
|
|
@ -35,6 +35,11 @@ internal interface VerificationTransport {
|
|||
onDone: (() -> Unit)?)
|
||||
|
||||
/**
|
||||
* @param supportedMethods list of supported method by this client
|
||||
* @param localId a local Id
|
||||
* @param otherUserId the user id to send the verification request to
|
||||
* @param roomId a room Id to use to send verification message
|
||||
* @param toDevices list of device Ids
|
||||
* @param callback will be called with eventId and ValidVerificationInfoRequest in case of success
|
||||
*/
|
||||
fun sendVerificationRequest(supportedMethods: List<String>,
|
||||
|
|
|
@ -96,7 +96,9 @@ internal fun EventEntity.markEventAsRoot(
|
|||
/**
|
||||
* Count the number of threads for the provided root thread eventId, and finds the latest event message.
|
||||
* Note: Redactions are handled by RedactionEventProcessor.
|
||||
* @param realm the realm database
|
||||
* @param rootThreadEventId The root eventId that will find the number of threads
|
||||
* @param chunkEntity the chunk entity
|
||||
* @return A ThreadSummary containing the counted threads and the latest event message
|
||||
*/
|
||||
internal fun EventEntity.threadSummaryInThread(realm: Realm, rootThreadEventId: String, chunkEntity: ChunkEntity?): Summary {
|
||||
|
@ -184,6 +186,7 @@ private fun findLatestSortedChunkEvent(chunk: ChunkEntity, rootThreadEventId: St
|
|||
|
||||
/**
|
||||
* Find all TimelineEventEntity that are root threads for the specified room.
|
||||
* @param realm the realm instance
|
||||
* @param roomId The room that all stored root threads will be returned
|
||||
*/
|
||||
internal fun TimelineEventEntity.Companion.findAllThreadsForRoomId(realm: Realm, roomId: String): RealmQuery<TimelineEventEntity> =
|
||||
|
@ -218,6 +221,7 @@ internal fun List<TimelineEvent>.mapEventsWithEdition(realm: Realm, roomId: Stri
|
|||
|
||||
/**
|
||||
* Returns a list of all the marked unread threads that exists for the specified room.
|
||||
* @param realm the realm instance
|
||||
* @param roomId The roomId that the user is currently in
|
||||
*/
|
||||
internal fun TimelineEventEntity.Companion.findAllLocalThreadNotificationsForRoomId(realm: Realm, roomId: String): RealmQuery<TimelineEventEntity> =
|
||||
|
@ -232,6 +236,7 @@ internal fun TimelineEventEntity.Companion.findAllLocalThreadNotificationsForRoo
|
|||
|
||||
/**
|
||||
* Returns whether or not the given user is participating in a current thread.
|
||||
* @param realm the realm instance
|
||||
* @param roomId the room that the thread exists
|
||||
* @param rootThreadEventId the thread that the search will be done
|
||||
* @param senderId the user that will try to find participation
|
||||
|
@ -247,6 +252,7 @@ internal fun TimelineEventEntity.Companion.isUserParticipatingInThread(realm: Re
|
|||
|
||||
/**
|
||||
* Returns whether or not the given user is mentioned in a current thread.
|
||||
* @param realm the realm instance
|
||||
* @param roomId the room that the thread exists
|
||||
* @param rootThreadEventId the thread that the search will be done
|
||||
* @param userId the user that will try to find if there is a mention
|
||||
|
|
|
@ -303,6 +303,7 @@ private fun getLatestEvent(rootThreadEvent: Event): Event? {
|
|||
/**
|
||||
* Find all ThreadSummaryEntity for the specified roomId, sorted by origin server.
|
||||
* note: Sorting cannot be provided by server, so we have to use that unstable property.
|
||||
* @param realm the realm instance
|
||||
* @param roomId The id of the room
|
||||
*/
|
||||
internal fun ThreadSummaryEntity.Companion.findAllThreadsForRoomId(realm: Realm, roomId: String): RealmQuery<ThreadSummaryEntity> =
|
||||
|
|
|
@ -32,6 +32,7 @@ import java.io.IOException
|
|||
* Execute a request from the requestBlock and handle some of the Exception it could generate
|
||||
* Ref: https://github.com/matrix-org/matrix-js-sdk/blob/develop/src/scheduler.js#L138-L175
|
||||
*
|
||||
* @param DATA type of data return by the [requestBlock]
|
||||
* @param globalErrorReceiver will be use to notify error such as invalid token error. See [GlobalError]
|
||||
* @param canRetry if set to true, the request will be executed again in case of error, after a delay
|
||||
* @param maxDelayBeforeRetry the max delay to wait before a retry. Note that in the case of a 429, if the provided delay exceeds this value, the error will
|
||||
|
|
|
@ -119,9 +119,11 @@ internal class RuntimeJsonAdapterFactory<T>(
|
|||
|
||||
companion object {
|
||||
/**
|
||||
* @param T the generic type to pass to [RuntimeJsonAdapterFactory]
|
||||
* @param baseType The base type for which this factory will create adapters. Cannot be Object.
|
||||
* @param labelKey The key in the JSON object whose value determines the type to which to map the
|
||||
* JSON object.
|
||||
* @param fallbackType
|
||||
*/
|
||||
@CheckReturnValue
|
||||
fun <T> of(baseType: Class<T>, labelKey: String, fallbackType: Class<out T>): RuntimeJsonAdapterFactory<T> {
|
||||
|
|
|
@ -94,6 +94,7 @@ internal object CertUtil {
|
|||
* Convert the fingerprint to an hexa string.
|
||||
*
|
||||
* @param fingerprint the fingerprint
|
||||
* @param sep the separator character, default to space
|
||||
* @return the hexa string.
|
||||
*/
|
||||
fun fingerprintToHexString(fingerprint: ByteArray, sep: Char = ' '): String {
|
||||
|
|
|
@ -24,11 +24,9 @@ import javax.net.ssl.X509TrustManager
|
|||
/**
|
||||
* Implements a TrustManager that checks Certificates against an explicit list of known
|
||||
* fingerprints.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param fingerprints Not empty array of SHA256 cert fingerprints
|
||||
* @param defaultTrustManager Optional trust manager to fall back on if cert does not match
|
||||
*
|
||||
* @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.
|
||||
*/
|
||||
internal class PinnedTrustManager(private val fingerprints: List<Fingerprint>,
|
||||
|
|
|
@ -28,11 +28,9 @@ import javax.net.ssl.X509ExtendedTrustManager
|
|||
/**
|
||||
* Implements a TrustManager that checks Certificates against an explicit list of known
|
||||
* fingerprints.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param fingerprints An array of SHA256 cert fingerprints
|
||||
* @param defaultTrustManager Optional trust manager to fall back on if cert does not match
|
||||
*
|
||||
* @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.
|
||||
*/
|
||||
@RequiresApi(Build.VERSION_CODES.N)
|
||||
|
|
|
@ -55,6 +55,7 @@ internal interface DirectoryAPI {
|
|||
/**
|
||||
* Add alias to the room.
|
||||
* @param roomAlias the room alias.
|
||||
* @param body the Json body
|
||||
*/
|
||||
@PUT(NetworkConstants.URI_API_PREFIX_PATH_R0 + "directory/room/{roomAlias}")
|
||||
suspend fun addRoomAlias(@Path("roomAlias") roomAlias: String,
|
||||
|
|
|
@ -32,6 +32,7 @@ internal interface OpenIdAPI {
|
|||
* Ref: https://matrix.org/docs/spec/client_server/latest#post-matrix-client-r0-user-userid-openid-request-token
|
||||
*
|
||||
* @param userId the user id
|
||||
* @param body an empty json body
|
||||
*/
|
||||
@POST(NetworkConstants.URI_API_PREFIX_PATH_R0 + "user/{userId}/openid/request_token")
|
||||
suspend fun openIdToken(@Path("userId") userId: String,
|
||||
|
|
|
@ -35,7 +35,7 @@ internal interface PushRulesApi {
|
|||
*
|
||||
* @param kind the notification kind (sender, room...)
|
||||
* @param ruleId the ruleId
|
||||
* @param enable the new enable status
|
||||
* @param enabledBody the new enable status
|
||||
*/
|
||||
@PUT(NetworkConstants.URI_API_PREFIX_PATH_R0 + "pushrules/global/{kind}/{ruleId}/enabled")
|
||||
suspend fun updateEnableRuleStatus(@Path("kind") kind: String,
|
||||
|
|
|
@ -364,6 +364,7 @@ internal class EventRelationsAggregationProcessor @Inject constructor(
|
|||
* Check if the edition is on the latest thread event, and update it accordingly.
|
||||
* @param editedEvent The event that will be changed
|
||||
* @param replaceEvent The new event
|
||||
* @param editions list of edition of event
|
||||
*/
|
||||
private fun handleThreadSummaryEdition(editedEvent: EventEntity?,
|
||||
replaceEvent: TimelineEventEntity?,
|
||||
|
|
|
@ -179,6 +179,7 @@ internal interface RoomAPI {
|
|||
* Invite a user to a room, using a ThreePid
|
||||
* Ref: https://matrix.org/docs/spec/client_server/r0.6.1#id101
|
||||
* @param roomId Required. The room identifier (not alias) to which to invite the user.
|
||||
* @param body the Json body
|
||||
*/
|
||||
@POST(NetworkConstants.URI_API_PREFIX_PATH_R0 + "rooms/{roomId}/invite")
|
||||
suspend fun invite3pid(@Path("roomId") roomId: String,
|
||||
|
@ -221,8 +222,13 @@ internal interface RoomAPI {
|
|||
|
||||
/**
|
||||
* Paginate relations for event based in normal topological order.
|
||||
* @param roomId the room Id
|
||||
* @param eventId the event Id
|
||||
* @param relationType filter for this relation type
|
||||
* @param eventType filter for this event type
|
||||
* @param from from token
|
||||
* @param to to token
|
||||
* @param limit max number of Event to retrieve
|
||||
*/
|
||||
@GET(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "rooms/{roomId}/relations/{eventId}/{relationType}/{eventType}")
|
||||
suspend fun getRelations(@Path("roomId") roomId: String,
|
||||
|
@ -236,7 +242,13 @@ internal interface RoomAPI {
|
|||
|
||||
/**
|
||||
* Paginate relations for thread events based in normal topological order.
|
||||
*
|
||||
* @param roomId the room Id
|
||||
* @param eventId the event Id
|
||||
* @param relationType filter for this relation type
|
||||
* @param from from token
|
||||
* @param to to token
|
||||
* @param limit max number of Event to retrieve
|
||||
*/
|
||||
@GET(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "rooms/{roomId}/relations/{eventId}/{relationType}")
|
||||
suspend fun getThreadsRelations(@Path("roomId") roomId: String,
|
||||
|
|
|
@ -21,8 +21,8 @@ import timber.log.Timber
|
|||
import java.util.concurrent.atomic.AtomicInteger
|
||||
|
||||
/**
|
||||
* @param queueIdentifier String value to identify a unique Queue
|
||||
* @param taskIdentifier String value to identify a unique Task. Should be different from queueIdentifier
|
||||
* @property queueIdentifier String value to identify a unique Queue
|
||||
* @property taskIdentifier String value to identify a unique Task. Should be different from queueIdentifier
|
||||
*/
|
||||
internal abstract class QueuedTask(
|
||||
val queueIdentifier: String,
|
||||
|
|
|
@ -24,6 +24,7 @@ import retrofit2.http.Query
|
|||
internal interface SpaceApi {
|
||||
|
||||
/**
|
||||
* @param spaceId the space Id
|
||||
* @param suggestedOnly Optional. If true, return only child events and rooms where the m.space.child event has suggested: true.
|
||||
* @param limit Optional: a client-defined limit to the maximum number of rooms to return per page. Must be a non-negative integer.
|
||||
* @param maxDepth Optional: The maximum depth in the tree (from the root room) to return.
|
||||
|
|
|
@ -206,6 +206,8 @@ internal class ThreadsAwarenessHandler @Inject constructor(
|
|||
/**
|
||||
* Handle for not thread events that we have marked them as root.
|
||||
* Find relations and inject them accordingly
|
||||
* @param realm the realm instance
|
||||
* @param roomId the current room Id
|
||||
* @param eventEntity the current eventEntity received
|
||||
* @param event the current event received
|
||||
* @return The content to inject in the roomSyncHandler live events
|
||||
|
@ -229,9 +231,12 @@ internal class ThreadsAwarenessHandler @Inject constructor(
|
|||
* This function is responsible to check if there is any event that relates to our current event.
|
||||
* This is useful when we receive an event that relates to a missing parent, so when later we receive the parent
|
||||
* we can update the child as well.
|
||||
* @param realm the realm instance
|
||||
* @param roomId the current room Id
|
||||
* @param event the current event that we examine
|
||||
* @param eventBody the current body of the event
|
||||
* @param isFromCache determines whether or not we already know this is root thread event
|
||||
* @param threadRelation the information about thread
|
||||
* @return The content to inject in the roomSyncHandler live events
|
||||
*/
|
||||
private fun handleEventsThatRelatesTo(
|
||||
|
@ -291,9 +296,12 @@ internal class ThreadsAwarenessHandler @Inject constructor(
|
|||
}
|
||||
|
||||
/**
|
||||
* Injecting $eventToInject decrypted content as a reply to $event.
|
||||
* @param eventToInject the event that will inject
|
||||
* Injecting [eventToInject] decrypted content as a reply to event.
|
||||
* @param roomId the room id
|
||||
* @param eventBody the actual event body
|
||||
* @param eventToInject the event that will inject
|
||||
* @param eventToInjectBody the event body to inject
|
||||
* @param threadRelation the information about thread
|
||||
* @return The final content with the injected event
|
||||
*/
|
||||
private fun injectEvent(roomId: String,
|
||||
|
|
|
@ -116,6 +116,8 @@ 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 eventData the modular data
|
||||
*/
|
||||
|
|
|
@ -27,6 +27,7 @@ internal interface WidgetsAPI {
|
|||
* Register to the server.
|
||||
*
|
||||
* @param body the body content (Ref: https://github.com/matrix-org/matrix-doc/pull/1961)
|
||||
* @param version the widget API version
|
||||
*/
|
||||
@POST("register")
|
||||
suspend fun register(@Body body: OpenIdToken,
|
||||
|
|
|
@ -24,6 +24,7 @@ import kotlinx.coroutines.sync.withPermit
|
|||
*/
|
||||
internal interface CoroutineSequencer {
|
||||
/**
|
||||
* @param T generic type
|
||||
* @param block the suspendable block to execute
|
||||
* @return the result of the block
|
||||
*/
|
||||
|
|
|
@ -53,7 +53,7 @@ internal object JsonCanonicalizer {
|
|||
/**
|
||||
* Canonicalize a JSON element.
|
||||
*
|
||||
* @param src the src
|
||||
* @param any the src
|
||||
* @return the canonicalize element
|
||||
*/
|
||||
private fun canonicalizeRecursive(any: Any): String {
|
||||
|
|
|
@ -76,6 +76,7 @@ internal class DefaultGetWellknownTask @Inject constructor(
|
|||
* - return action and .well-known data
|
||||
*
|
||||
* @param domain homeserver domain, deduced from mx userId (ex: "matrix.org" from userId "@user:matrix.org")
|
||||
* @param client Http client to perform the request
|
||||
*/
|
||||
private suspend fun findClientConfig(domain: String, client: OkHttpClient): WellknownResult {
|
||||
val wellKnownAPI = retrofitFactory.create(client, "https://dummy.org")
|
||||
|
|
|
@ -39,6 +39,7 @@ class UnrecognizedCertificateDialog @Inject constructor(
|
|||
* Display a certificate dialog box, asking the user about an unknown certificate
|
||||
* To use when user is currently logged in.
|
||||
*
|
||||
* @param activity the Android activity
|
||||
* @param unrecognizedFingerprint the fingerprint for the unknown certificate
|
||||
* @param callback callback to fire when the user makes a decision
|
||||
*/
|
||||
|
@ -80,9 +81,13 @@ class UnrecognizedCertificateDialog @Inject constructor(
|
|||
/**
|
||||
* Display a certificate dialog box, asking the user about an unknown certificate.
|
||||
*
|
||||
* @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 userId the matrix userId
|
||||
* @param homeServerUrl the homeserver url
|
||||
* @param homeServerConnectionConfigHasFingerprints true if the homeServerConnectionConfig has fingerprint
|
||||
*/
|
||||
private fun internalShow(activity: Activity,
|
||||
unrecognizedFingerprint: Fingerprint,
|
||||
|
|
|
@ -29,9 +29,11 @@ sealed class ExternalIntentData {
|
|||
/**
|
||||
* Constructor for a text message.
|
||||
*
|
||||
* @param text the text
|
||||
* @param htmlText the HTML text
|
||||
* @param format the formatted text format
|
||||
* @property text the text
|
||||
* @property htmlText the HTML text
|
||||
* @property format the formatted text format
|
||||
* @property clipDataItem the ClipData
|
||||
* @property mimeType the mimetype
|
||||
*/
|
||||
data class IntentDataText(
|
||||
val text: CharSequence? = null,
|
||||
|
@ -52,8 +54,8 @@ sealed class ExternalIntentData {
|
|||
/**
|
||||
* Constructor from a media Uri/.
|
||||
*
|
||||
* @param uri the media uri
|
||||
* @param filename the media file name
|
||||
* @property uri the media uri
|
||||
* @property filename the media file name
|
||||
*/
|
||||
data class IntentDataUri(
|
||||
val uri: Uri,
|
||||
|
|
|
@ -27,6 +27,7 @@ import java.util.Locale
|
|||
* Returns the mimetype from a uri.
|
||||
*
|
||||
* @param context the context
|
||||
* @param uri the uri
|
||||
* @return the mimetype
|
||||
*/
|
||||
fun getMimeTypeFromUri(context: Context, uri: Uri): String? {
|
||||
|
|
|
@ -45,7 +45,7 @@ class PushRulePreference : VectorPreference {
|
|||
/**
|
||||
* Update the notification index.
|
||||
*
|
||||
* @param pushRule
|
||||
* @param notificationIndex the new notification index
|
||||
*/
|
||||
fun setIndex(notificationIndex: NotificationIndex?) {
|
||||
index = notificationIndex
|
||||
|
|
|
@ -54,6 +54,7 @@ class KeysBackupBanner @JvmOverloads constructor(
|
|||
* This methods is responsible for rendering the view according to the newState.
|
||||
*
|
||||
* @param newState the newState representing the view
|
||||
* @param force true to force the rendering of the view
|
||||
*/
|
||||
fun render(newState: State, force: Boolean = false) {
|
||||
if (newState == state && !force) {
|
||||
|
|
|
@ -90,6 +90,7 @@ fun getCallRingtoneName(context: Context): String? {
|
|||
/**
|
||||
* Sets the selected ringtone for riot calls.
|
||||
*
|
||||
* @param context Android context
|
||||
* @param ringtoneUri
|
||||
* @see Ringtone
|
||||
*/
|
||||
|
|
|
@ -83,6 +83,8 @@ fun requestDisablingBatteryOptimization(activity: Activity, activityResultLaunch
|
|||
*
|
||||
* @param context the context
|
||||
* @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
|
||||
*/
|
||||
fun copyToClipboard(context: Context, text: CharSequence, showToast: Boolean = true, @StringRes toastMessage: Int = R.string.copied_to_clipboard) {
|
||||
val clipboard = context.getSystemService<ClipboardManager>()!!
|
||||
|
|
|
@ -23,7 +23,8 @@ const val THREE_MINUTES = 3 * 60_000L
|
|||
|
||||
/**
|
||||
* Store an object T for a specific period of time.
|
||||
* @param delay delay to keep the data, in millis
|
||||
* @param T type of the data to store
|
||||
* @property delay delay to keep the data, in millis
|
||||
*/
|
||||
open class TemporaryStore<T>(private val delay: Long = THREE_MINUTES) {
|
||||
|
||||
|
|
|
@ -122,6 +122,7 @@ class CallAudioManager(private val context: Context, val configChange: (() -> Un
|
|||
* Updates the audio route for the given mode.
|
||||
*
|
||||
* @param mode the audio mode to be used when computing the audio route.
|
||||
* @param force true to force setting the audio route
|
||||
* @return `true` if the audio route was updated successfully;
|
||||
* `false`, otherwise.
|
||||
*/
|
||||
|
|
|
@ -31,6 +31,7 @@ class CommandParser @Inject constructor() {
|
|||
* Convert the text message into a Slash command.
|
||||
*
|
||||
* @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)
|
||||
*/
|
||||
fun parseSlashCommand(textMessage: CharSequence, isInThreadTimeline: Boolean): ParsedCommand {
|
||||
|
@ -412,8 +413,8 @@ class CommandParser @Inject constructor() {
|
|||
|
||||
/**
|
||||
* Checks whether or not the current command is not supported by threads.
|
||||
* @param slashCommand the slash command that will be checked
|
||||
* @param isInThreadTimeline if its true we are in a thread timeline
|
||||
* @param slashCommand the slash command that will be checked
|
||||
* @return The command that is not supported
|
||||
*/
|
||||
private fun getNotSupportedByThreads(isInThreadTimeline: Boolean, slashCommand: String): Command? {
|
||||
|
|
|
@ -55,8 +55,15 @@ class MergedHeaderItemFactory @Inject constructor(private val activeSessionHolde
|
|||
private val mergeItemCollapseStates = HashMap<Long, Boolean>()
|
||||
|
||||
/**
|
||||
* @param event the main timeline event
|
||||
* @param nextEvent is an older event than event
|
||||
* @param items all known items, sorted from newer event to oldest event
|
||||
* @param partialState partial state data
|
||||
* @param addDaySeparator true to add a day separator
|
||||
* @param currentPosition the current position
|
||||
* @param eventIdToHighlight if not null the event which has to be highlighted
|
||||
* @param callback callback for user event
|
||||
* @param requestModelBuild lambda to let the built Item request a model build when the collapse state is changed
|
||||
*/
|
||||
fun create(event: TimelineEvent,
|
||||
nextEvent: TimelineEvent?,
|
||||
|
|
|
@ -36,6 +36,8 @@ class TimelineEventVisibilityHelper @Inject constructor(private val userPreferen
|
|||
* @param index the index to start computing (inclusive)
|
||||
* @param minSize the minimum number of same type events to have sequentially, otherwise will return an empty list
|
||||
* @param eventIdToHighlight used to compute visibility
|
||||
* @param rootThreadEventId the root thread event id if in a thread timeline
|
||||
* @param isFromThreadTimeline true if the timeline is a thread
|
||||
*
|
||||
* @return a list of timeline events which have sequentially the same type following the next direction.
|
||||
*/
|
||||
|
@ -86,6 +88,8 @@ class TimelineEventVisibilityHelper @Inject constructor(private val userPreferen
|
|||
* @param index the index to start computing (inclusive)
|
||||
* @param minSize the minimum number of same type events to have sequentially, otherwise will return an empty list
|
||||
* @param eventIdToHighlight used to compute visibility
|
||||
* @param rootThreadEventId the root thread eventId
|
||||
* @param isFromThreadTimeline true if the timeline is a thread
|
||||
*
|
||||
* @return a list of timeline events which have sequentially the same type following the prev direction.
|
||||
*/
|
||||
|
@ -107,6 +111,7 @@ class TimelineEventVisibilityHelper @Inject constructor(private val userPreferen
|
|||
/**
|
||||
* @param timelineEvent the event to check for visibility
|
||||
* @param highlightedEventId can be checked to force visibility to true
|
||||
* @param isFromThreadTimeline true if the timeline is a thread
|
||||
* @param rootThreadEventId if this param is null it means we are in the original timeline
|
||||
* @return true if the event should be shown in the timeline.
|
||||
*/
|
||||
|
|
|
@ -59,6 +59,8 @@ class PreviewUrlView @JvmOverloads constructor(
|
|||
* This methods is responsible for rendering the view according to the newState.
|
||||
*
|
||||
* @param newState the newState representing the view
|
||||
* @param imageContentRenderer the tool to render the image
|
||||
* @param force true to force refresh
|
||||
*/
|
||||
fun render(newState: PreviewUrlUiState,
|
||||
imageContentRenderer: ImageContentRenderer,
|
||||
|
|
|
@ -233,6 +233,7 @@ class NotificationUtils @Inject constructor(
|
|||
* Build a polling thread listener notification.
|
||||
*
|
||||
* @param subTitleResId subtitle string resource Id of the notification
|
||||
* @param withProgress true to show indeterminate progress on the notification
|
||||
* @return the polling thread listener notification
|
||||
*/
|
||||
@SuppressLint("NewApi")
|
||||
|
@ -298,10 +299,8 @@ class NotificationUtils @Inject constructor(
|
|||
* Build an incoming call notification.
|
||||
* This notification starts the VectorHomeActivity which is in charge of centralizing the incoming call flow.
|
||||
*
|
||||
* @param isVideo true if this is a video call, false for voice call
|
||||
* @param roomName the room name in which the call is pending.
|
||||
* @param matrixId the matrix id
|
||||
* @param callId the call id.
|
||||
* @param call information about the call
|
||||
* @param title title of the notification
|
||||
* @param fromBg true if the app is in background when posting the notification
|
||||
* @return the call notification.
|
||||
*/
|
||||
|
@ -430,11 +429,8 @@ class NotificationUtils @Inject constructor(
|
|||
/**
|
||||
* Build a pending call notification.
|
||||
*
|
||||
* @param isVideo true if this is a video call, false for voice call
|
||||
* @param roomName the room name in which the call is pending.
|
||||
* @param roomId the room Id
|
||||
* @param matrixId the matrix id
|
||||
* @param callId the call id.
|
||||
* @param call information about the call
|
||||
* @param title title of the notification
|
||||
* @return the call notification.
|
||||
*/
|
||||
@SuppressLint("NewApi")
|
||||
|
|
|
@ -162,6 +162,9 @@ class BugReporter @Inject constructor(
|
|||
* @param withKeyRequestHistory true to include the crash logs
|
||||
* @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
|
||||
*/
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
|
@ -287,7 +290,8 @@ class BugReporter @Inject constructor(
|
|||
.addFormDataPart("app_language", VectorLocale.applicationLocale.toString())
|
||||
.addFormDataPart("default_app_language", systemLocaleProvider.getSystemLocale().toString())
|
||||
.addFormDataPart("theme", ThemeUtils.getApplicationTheme(context))
|
||||
.addFormDataPart("server_version", serverVersion).apply {
|
||||
.addFormDataPart("server_version", serverVersion)
|
||||
.apply {
|
||||
customFields?.forEach { (name, value) ->
|
||||
addFormDataPart(name, value)
|
||||
}
|
||||
|
|
|
@ -78,6 +78,7 @@ object FontScale {
|
|||
/**
|
||||
* Store the font scale value.
|
||||
*
|
||||
* @param context the Android context
|
||||
* @param fontScaleValue the font scale value to store
|
||||
*/
|
||||
private fun saveFontScaleValue(context: Context, fontScaleValue: FontScaleValue) {
|
||||
|
|
|
@ -108,6 +108,7 @@ object ThemeUtils {
|
|||
/**
|
||||
* Update the application theme.
|
||||
*
|
||||
* @param context the Android context
|
||||
* @param aTheme the new theme
|
||||
*/
|
||||
fun setApplicationTheme(context: Context, aTheme: String) {
|
||||
|
@ -126,9 +127,11 @@ object ThemeUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* Set the activity theme according to the selected one.
|
||||
* Set the activity theme according to the selected one. Default is Light, so if this is the current
|
||||
* theme, the theme is not changed.
|
||||
*
|
||||
* @param activity the activity
|
||||
* @param otherThemes themes to apply for dark and black theme
|
||||
*/
|
||||
fun setActivityTheme(activity: Activity, otherThemes: ActivityOtherThemes) {
|
||||
when (getApplicationTheme(activity)) {
|
||||
|
|
|
@ -110,6 +110,7 @@ class WidgetPostAPIHandler @AssistedInject constructor(@Assisted private val roo
|
|||
/**
|
||||
* Retrieve the latest botOptions event.
|
||||
*
|
||||
* @param widgetPostAPIMediator the post api mediator
|
||||
* @param eventData the modular data
|
||||
*/
|
||||
private fun getBotOptions(widgetPostAPIMediator: WidgetPostAPIMediator, eventData: JsonDict) {
|
||||
|
@ -171,6 +172,7 @@ class WidgetPostAPIHandler @AssistedInject constructor(@Assisted private val roo
|
|||
/**
|
||||
* Provides the membership state.
|
||||
*
|
||||
* @param widgetPostAPIMediator the post api mediator
|
||||
* @param eventData the modular data
|
||||
*/
|
||||
private fun getMembershipState(widgetPostAPIMediator: WidgetPostAPIMediator, eventData: JsonDict) {
|
||||
|
@ -190,6 +192,7 @@ class WidgetPostAPIHandler @AssistedInject constructor(@Assisted private val roo
|
|||
/**
|
||||
* Request the latest joined room event.
|
||||
*
|
||||
* @param widgetPostAPIMediator the post api mediator
|
||||
* @param eventData the modular data
|
||||
*/
|
||||
private fun getJoinRules(widgetPostAPIMediator: WidgetPostAPIMediator, eventData: JsonDict) {
|
||||
|
@ -208,6 +211,7 @@ class WidgetPostAPIHandler @AssistedInject constructor(@Assisted private val roo
|
|||
/**
|
||||
* Provide the widgets list.
|
||||
*
|
||||
* @param widgetPostAPIMediator the post api mediator
|
||||
* @param eventData the modular data
|
||||
*/
|
||||
private fun getWidgets(widgetPostAPIMediator: WidgetPostAPIMediator, eventData: JsonDict) {
|
||||
|
@ -228,6 +232,7 @@ class WidgetPostAPIHandler @AssistedInject constructor(@Assisted private val roo
|
|||
/**
|
||||
* Set a new widget.
|
||||
*
|
||||
* @param widgetPostAPIMediator the post api mediator
|
||||
* @param eventData the modular data
|
||||
*/
|
||||
private fun setWidget(widgetPostAPIMediator: WidgetPostAPIMediator, eventData: JsonDict) {
|
||||
|
@ -303,6 +308,7 @@ class WidgetPostAPIHandler @AssistedInject constructor(@Assisted private val roo
|
|||
/**
|
||||
* Update the 'plumbing state".
|
||||
*
|
||||
* @param widgetPostAPIMediator the post api mediator
|
||||
* @param eventData the modular data
|
||||
*/
|
||||
private fun setPlumbingState(widgetPostAPIMediator: WidgetPostAPIMediator, eventData: JsonDict) {
|
||||
|
@ -328,6 +334,7 @@ class WidgetPostAPIHandler @AssistedInject constructor(@Assisted private val roo
|
|||
/**
|
||||
* Update the bot options.
|
||||
*
|
||||
* @param widgetPostAPIMediator the post api mediator
|
||||
* @param eventData the modular data
|
||||
*/
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
|
@ -353,6 +360,7 @@ class WidgetPostAPIHandler @AssistedInject constructor(@Assisted private val roo
|
|||
/**
|
||||
* Update the bot power levels.
|
||||
*
|
||||
* @param widgetPostAPIMediator the post api mediator
|
||||
* @param eventData the modular data
|
||||
*/
|
||||
private fun setBotPower(widgetPostAPIMediator: WidgetPostAPIMediator, eventData: JsonDict) {
|
||||
|
@ -375,6 +383,7 @@ class WidgetPostAPIHandler @AssistedInject constructor(@Assisted private val roo
|
|||
/**
|
||||
* Invite an user to this room.
|
||||
*
|
||||
* @param widgetPostAPIMediator the post api mediator
|
||||
* @param eventData the modular data
|
||||
*/
|
||||
private fun inviteUser(widgetPostAPIMediator: WidgetPostAPIMediator, eventData: JsonDict) {
|
||||
|
@ -397,6 +406,7 @@ class WidgetPostAPIHandler @AssistedInject constructor(@Assisted private val roo
|
|||
/**
|
||||
* Provides the number of members in the rooms.
|
||||
*
|
||||
* @param widgetPostAPIMediator the post api mediator
|
||||
* @param eventData the modular data
|
||||
*/
|
||||
private fun getMembershipCount(widgetPostAPIMediator: WidgetPostAPIMediator, eventData: JsonDict) {
|
||||
|
|
Loading…
Reference in a new issue