Format files, in particular align `->`
This commit is contained in:
parent
ff56414695
commit
ede5bb0e90
|
@ -4,16 +4,7 @@
|
||||||
<JetCodeStyleSettings>
|
<JetCodeStyleSettings>
|
||||||
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
|
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
|
||||||
<value>
|
<value>
|
||||||
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
|
<package name="kotlinx.android.synthetic" withSubpackages="true" static="false" />
|
||||||
</value>
|
|
||||||
</option>
|
|
||||||
<option name="PACKAGES_IMPORT_LAYOUT">
|
|
||||||
<value>
|
|
||||||
<package name="" alias="false" withSubpackages="true" />
|
|
||||||
<package name="java" alias="false" withSubpackages="true" />
|
|
||||||
<package name="javax" alias="false" withSubpackages="true" />
|
|
||||||
<package name="kotlin" alias="false" withSubpackages="true" />
|
|
||||||
<package name="" alias="true" withSubpackages="true" />
|
|
||||||
</value>
|
</value>
|
||||||
</option>
|
</option>
|
||||||
<option name="ALIGN_IN_COLUMNS_CASE_BRANCH" value="true" />
|
<option name="ALIGN_IN_COLUMNS_CASE_BRANCH" value="true" />
|
||||||
|
|
|
@ -48,18 +48,25 @@ data class MatrixError(
|
||||||
companion object {
|
companion object {
|
||||||
/** Forbidden access, e.g. joining a room without permission, failed login. */
|
/** Forbidden access, e.g. joining a room without permission, failed login. */
|
||||||
const val M_FORBIDDEN = "M_FORBIDDEN"
|
const val M_FORBIDDEN = "M_FORBIDDEN"
|
||||||
|
|
||||||
/** An unknown error has occurred. */
|
/** An unknown error has occurred. */
|
||||||
const val M_UNKNOWN = "M_UNKNOWN"
|
const val M_UNKNOWN = "M_UNKNOWN"
|
||||||
|
|
||||||
/** The access token specified was not recognised. */
|
/** The access token specified was not recognised. */
|
||||||
const val M_UNKNOWN_TOKEN = "M_UNKNOWN_TOKEN"
|
const val M_UNKNOWN_TOKEN = "M_UNKNOWN_TOKEN"
|
||||||
|
|
||||||
/** No access token was specified for the request. */
|
/** No access token was specified for the request. */
|
||||||
const val M_MISSING_TOKEN = "M_MISSING_TOKEN"
|
const val M_MISSING_TOKEN = "M_MISSING_TOKEN"
|
||||||
|
|
||||||
/** Request contained valid JSON, but it was malformed in some way, e.g. missing required keys, invalid values for keys. */
|
/** Request contained valid JSON, but it was malformed in some way, e.g. missing required keys, invalid values for keys. */
|
||||||
const val M_BAD_JSON = "M_BAD_JSON"
|
const val M_BAD_JSON = "M_BAD_JSON"
|
||||||
|
|
||||||
/** Request did not contain valid JSON. */
|
/** Request did not contain valid JSON. */
|
||||||
const val M_NOT_JSON = "M_NOT_JSON"
|
const val M_NOT_JSON = "M_NOT_JSON"
|
||||||
|
|
||||||
/** No resource was found for this request. */
|
/** No resource was found for this request. */
|
||||||
const val M_NOT_FOUND = "M_NOT_FOUND"
|
const val M_NOT_FOUND = "M_NOT_FOUND"
|
||||||
|
|
||||||
/** Too many requests have been sent in a short period of time. Wait a while then try again. */
|
/** Too many requests have been sent in a short period of time. Wait a while then try again. */
|
||||||
const val M_LIMIT_EXCEEDED = "M_LIMIT_EXCEEDED"
|
const val M_LIMIT_EXCEEDED = "M_LIMIT_EXCEEDED"
|
||||||
|
|
||||||
|
@ -69,68 +76,97 @@ data class MatrixError(
|
||||||
|
|
||||||
/** Encountered when trying to register a user ID which has been taken. */
|
/** Encountered when trying to register a user ID which has been taken. */
|
||||||
const val M_USER_IN_USE = "M_USER_IN_USE"
|
const val M_USER_IN_USE = "M_USER_IN_USE"
|
||||||
|
|
||||||
/** Sent when the room alias given to the createRoom API is already in use. */
|
/** Sent when the room alias given to the createRoom API is already in use. */
|
||||||
const val M_ROOM_IN_USE = "M_ROOM_IN_USE"
|
const val M_ROOM_IN_USE = "M_ROOM_IN_USE"
|
||||||
|
|
||||||
/** (Not documented yet) */
|
/** (Not documented yet) */
|
||||||
const val M_BAD_PAGINATION = "M_BAD_PAGINATION"
|
const val M_BAD_PAGINATION = "M_BAD_PAGINATION"
|
||||||
|
|
||||||
/** The request was not correctly authorized. Usually due to login failures. */
|
/** The request was not correctly authorized. Usually due to login failures. */
|
||||||
const val M_UNAUTHORIZED = "M_UNAUTHORIZED"
|
const val M_UNAUTHORIZED = "M_UNAUTHORIZED"
|
||||||
|
|
||||||
/** (Not documented yet) */
|
/** (Not documented yet) */
|
||||||
const val M_OLD_VERSION = "M_OLD_VERSION"
|
const val M_OLD_VERSION = "M_OLD_VERSION"
|
||||||
|
|
||||||
/** The server did not understand the request. */
|
/** The server did not understand the request. */
|
||||||
const val M_UNRECOGNIZED = "M_UNRECOGNIZED"
|
const val M_UNRECOGNIZED = "M_UNRECOGNIZED"
|
||||||
|
|
||||||
/** (Not documented yet) */
|
/** (Not documented yet) */
|
||||||
const val M_LOGIN_EMAIL_URL_NOT_YET = "M_LOGIN_EMAIL_URL_NOT_YET"
|
const val M_LOGIN_EMAIL_URL_NOT_YET = "M_LOGIN_EMAIL_URL_NOT_YET"
|
||||||
|
|
||||||
/** Authentication could not be performed on the third party identifier. */
|
/** Authentication could not be performed on the third party identifier. */
|
||||||
const val M_THREEPID_AUTH_FAILED = "M_THREEPID_AUTH_FAILED"
|
const val M_THREEPID_AUTH_FAILED = "M_THREEPID_AUTH_FAILED"
|
||||||
|
|
||||||
/** Sent when a threepid given to an API cannot be used because no record matching the threepid was found. */
|
/** Sent when a threepid given to an API cannot be used because no record matching the threepid was found. */
|
||||||
const val M_THREEPID_NOT_FOUND = "M_THREEPID_NOT_FOUND"
|
const val M_THREEPID_NOT_FOUND = "M_THREEPID_NOT_FOUND"
|
||||||
|
|
||||||
/** Sent when a threepid given to an API cannot be used because the same threepid is already in use. */
|
/** Sent when a threepid given to an API cannot be used because the same threepid is already in use. */
|
||||||
const val M_THREEPID_IN_USE = "M_THREEPID_IN_USE"
|
const val M_THREEPID_IN_USE = "M_THREEPID_IN_USE"
|
||||||
|
|
||||||
/** The client's request used a third party server, eg. identity server, that this server does not trust. */
|
/** The client's request used a third party server, eg. identity server, that this server does not trust. */
|
||||||
const val M_SERVER_NOT_TRUSTED = "M_SERVER_NOT_TRUSTED"
|
const val M_SERVER_NOT_TRUSTED = "M_SERVER_NOT_TRUSTED"
|
||||||
|
|
||||||
/** The request or entity was too large. */
|
/** The request or entity was too large. */
|
||||||
const val M_TOO_LARGE = "M_TOO_LARGE"
|
const val M_TOO_LARGE = "M_TOO_LARGE"
|
||||||
|
|
||||||
/** (Not documented yet) */
|
/** (Not documented yet) */
|
||||||
const val M_CONSENT_NOT_GIVEN = "M_CONSENT_NOT_GIVEN"
|
const val M_CONSENT_NOT_GIVEN = "M_CONSENT_NOT_GIVEN"
|
||||||
|
|
||||||
/** The request cannot be completed because the homeserver has reached a resource limit imposed on it. For example,
|
/** The request cannot be completed because the homeserver has reached a resource limit imposed on it. For example,
|
||||||
* a homeserver held in a shared hosting environment may reach a resource limit if it starts using too much memory
|
* a homeserver held in a shared hosting environment may reach a resource limit if it starts using too much memory
|
||||||
* or disk space. The error MUST have an admin_contact field to provide the user receiving the error a place to reach
|
* or disk space. The error MUST have an admin_contact field to provide the user receiving the error a place to reach
|
||||||
* out to. Typically, this error will appear on routes which attempt to modify state (eg: sending messages, account
|
* out to. Typically, this error will appear on routes which attempt to modify state (eg: sending messages, account
|
||||||
* data, etc) and not routes which only read state (eg: /sync, get account data, etc). */
|
* data, etc) and not routes which only read state (eg: /sync, get account data, etc). */
|
||||||
const val M_RESOURCE_LIMIT_EXCEEDED = "M_RESOURCE_LIMIT_EXCEEDED"
|
const val M_RESOURCE_LIMIT_EXCEEDED = "M_RESOURCE_LIMIT_EXCEEDED"
|
||||||
|
|
||||||
/** The user ID associated with the request has been deactivated. Typically for endpoints that prove authentication, such as /login. */
|
/** The user ID associated with the request has been deactivated. Typically for endpoints that prove authentication, such as /login. */
|
||||||
const val M_USER_DEACTIVATED = "M_USER_DEACTIVATED"
|
const val M_USER_DEACTIVATED = "M_USER_DEACTIVATED"
|
||||||
|
|
||||||
/** Encountered when trying to register a user ID which is not valid. */
|
/** Encountered when trying to register a user ID which is not valid. */
|
||||||
const val M_INVALID_USERNAME = "M_INVALID_USERNAME"
|
const val M_INVALID_USERNAME = "M_INVALID_USERNAME"
|
||||||
|
|
||||||
/** Sent when the initial state given to the createRoom API is invalid. */
|
/** Sent when the initial state given to the createRoom API is invalid. */
|
||||||
const val M_INVALID_ROOM_STATE = "M_INVALID_ROOM_STATE"
|
const val M_INVALID_ROOM_STATE = "M_INVALID_ROOM_STATE"
|
||||||
|
|
||||||
/** The server does not permit this third party identifier. This may happen if the server only permits,
|
/** The server does not permit this third party identifier. This may happen if the server only permits,
|
||||||
* for example, email addresses from a particular domain. */
|
* for example, email addresses from a particular domain. */
|
||||||
const val M_THREEPID_DENIED = "M_THREEPID_DENIED"
|
const val M_THREEPID_DENIED = "M_THREEPID_DENIED"
|
||||||
|
|
||||||
/** The client's request to create a room used a room version that the server does not support. */
|
/** The client's request to create a room used a room version that the server does not support. */
|
||||||
const val M_UNSUPPORTED_ROOM_VERSION = "M_UNSUPPORTED_ROOM_VERSION"
|
const val M_UNSUPPORTED_ROOM_VERSION = "M_UNSUPPORTED_ROOM_VERSION"
|
||||||
|
|
||||||
/** The client attempted to join a room that has a version the server does not support.
|
/** The client attempted to join a room that has a version the server does not support.
|
||||||
* Inspect the room_version property of the error response for the room's version. */
|
* Inspect the room_version property of the error response for the room's version. */
|
||||||
const val M_INCOMPATIBLE_ROOM_VERSION = "M_INCOMPATIBLE_ROOM_VERSION"
|
const val M_INCOMPATIBLE_ROOM_VERSION = "M_INCOMPATIBLE_ROOM_VERSION"
|
||||||
|
|
||||||
/** The state change requested cannot be performed, such as attempting to unban a user who is not banned. */
|
/** The state change requested cannot be performed, such as attempting to unban a user who is not banned. */
|
||||||
const val M_BAD_STATE = "M_BAD_STATE"
|
const val M_BAD_STATE = "M_BAD_STATE"
|
||||||
|
|
||||||
/** The room or resource does not permit guests to access it. */
|
/** The room or resource does not permit guests to access it. */
|
||||||
const val M_GUEST_ACCESS_FORBIDDEN = "M_GUEST_ACCESS_FORBIDDEN"
|
const val M_GUEST_ACCESS_FORBIDDEN = "M_GUEST_ACCESS_FORBIDDEN"
|
||||||
|
|
||||||
/** A Captcha is required to complete the request. */
|
/** A Captcha is required to complete the request. */
|
||||||
const val M_CAPTCHA_NEEDED = "M_CAPTCHA_NEEDED"
|
const val M_CAPTCHA_NEEDED = "M_CAPTCHA_NEEDED"
|
||||||
|
|
||||||
/** The Captcha provided did not match what was expected. */
|
/** The Captcha provided did not match what was expected. */
|
||||||
const val M_CAPTCHA_INVALID = "M_CAPTCHA_INVALID"
|
const val M_CAPTCHA_INVALID = "M_CAPTCHA_INVALID"
|
||||||
|
|
||||||
/** A required parameter was missing from the request. */
|
/** A required parameter was missing from the request. */
|
||||||
const val M_MISSING_PARAM = "M_MISSING_PARAM"
|
const val M_MISSING_PARAM = "M_MISSING_PARAM"
|
||||||
|
|
||||||
/** A parameter that was specified has the wrong value. For example, the server expected an integer and instead received a string. */
|
/** A parameter that was specified has the wrong value. For example, the server expected an integer and instead received a string. */
|
||||||
const val M_INVALID_PARAM = "M_INVALID_PARAM"
|
const val M_INVALID_PARAM = "M_INVALID_PARAM"
|
||||||
|
|
||||||
/** The resource being requested is reserved by an application service, or the application service making the request has not created the resource. */
|
/** The resource being requested is reserved by an application service, or the application service making the request has not created the resource. */
|
||||||
const val M_EXCLUSIVE = "M_EXCLUSIVE"
|
const val M_EXCLUSIVE = "M_EXCLUSIVE"
|
||||||
|
|
||||||
/** The user is unable to reject an invite to join the server notices room. See the Server Notices module for more information. */
|
/** The user is unable to reject an invite to join the server notices room. See the Server Notices module for more information. */
|
||||||
const val M_CANNOT_LEAVE_SERVER_NOTICE_ROOM = "M_CANNOT_LEAVE_SERVER_NOTICE_ROOM"
|
const val M_CANNOT_LEAVE_SERVER_NOTICE_ROOM = "M_CANNOT_LEAVE_SERVER_NOTICE_ROOM"
|
||||||
|
|
||||||
/** (Not documented yet) */
|
/** (Not documented yet) */
|
||||||
const val M_WRONG_ROOM_KEYS_VERSION = "M_WRONG_ROOM_KEYS_VERSION"
|
const val M_WRONG_ROOM_KEYS_VERSION = "M_WRONG_ROOM_KEYS_VERSION"
|
||||||
|
|
||||||
/** (Not documented yet) */
|
/** (Not documented yet) */
|
||||||
const val M_WEAK_PASSWORD = "M_WEAK_PASSWORD"
|
const val M_WEAK_PASSWORD = "M_WEAK_PASSWORD"
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ interface MxCallDetail {
|
||||||
interface MxCall : MxCallDetail {
|
interface MxCall : MxCallDetail {
|
||||||
|
|
||||||
var state: CallState
|
var state: CallState
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pick Up the incoming call
|
* Pick Up the incoming call
|
||||||
* It has no effect on outgoing call
|
* It has no effect on outgoing call
|
||||||
|
|
|
@ -53,23 +53,31 @@ package org.matrix.android.sdk.api.session.crypto.keysbackup
|
||||||
enum class KeysBackupState {
|
enum class KeysBackupState {
|
||||||
// Need to check the current backup version on the homeserver
|
// Need to check the current backup version on the homeserver
|
||||||
Unknown,
|
Unknown,
|
||||||
|
|
||||||
// Checking if backup is enabled on home server
|
// Checking if backup is enabled on home server
|
||||||
CheckingBackUpOnHomeserver,
|
CheckingBackUpOnHomeserver,
|
||||||
|
|
||||||
// Backup has been stopped because a new backup version has been detected on the homeserver
|
// Backup has been stopped because a new backup version has been detected on the homeserver
|
||||||
WrongBackUpVersion,
|
WrongBackUpVersion,
|
||||||
|
|
||||||
// Backup from this device is not enabled
|
// Backup from this device is not enabled
|
||||||
Disabled,
|
Disabled,
|
||||||
|
|
||||||
// There is a backup available on the homeserver but it is not trusted.
|
// There is a backup available on the homeserver but it is not trusted.
|
||||||
// It is not trusted because the signature is invalid or the device that created it is not verified
|
// It is not trusted because the signature is invalid or the device that created it is not verified
|
||||||
// Use [KeysBackup.getKeysBackupTrust()] to get trust details.
|
// Use [KeysBackup.getKeysBackupTrust()] to get trust details.
|
||||||
// Consequently, the backup from this device is not enabled.
|
// Consequently, the backup from this device is not enabled.
|
||||||
NotTrusted,
|
NotTrusted,
|
||||||
|
|
||||||
// Backup is being enabled: the backup version is being created on the homeserver
|
// Backup is being enabled: the backup version is being created on the homeserver
|
||||||
Enabling,
|
Enabling,
|
||||||
|
|
||||||
// Backup is enabled and ready to send backup to the homeserver
|
// Backup is enabled and ready to send backup to the homeserver
|
||||||
ReadyToBackUp,
|
ReadyToBackUp,
|
||||||
|
|
||||||
// e2e keys are going to be sent to the homeserver
|
// e2e keys are going to be sent to the homeserver
|
||||||
WillBackUp,
|
WillBackUp,
|
||||||
|
|
||||||
// e2e keys are being sent to the homeserver
|
// e2e keys are being sent to the homeserver
|
||||||
BackingUp
|
BackingUp
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,8 +22,10 @@ package org.matrix.android.sdk.api.session.crypto.verification
|
||||||
enum class VerificationMethod {
|
enum class VerificationMethod {
|
||||||
// Use it when your application supports the SAS verification method
|
// Use it when your application supports the SAS verification method
|
||||||
SAS,
|
SAS,
|
||||||
|
|
||||||
// Use it if your application is able to display QR codes
|
// Use it if your application is able to display QR codes
|
||||||
QR_CODE_SHOW,
|
QR_CODE_SHOW,
|
||||||
|
|
||||||
// Use it if your application is able to scan QR codes
|
// Use it if your application is able to scan QR codes
|
||||||
QR_CODE_SCAN
|
QR_CODE_SCAN
|
||||||
}
|
}
|
||||||
|
|
|
@ -253,6 +253,7 @@ fun Event.isFileMessage(): Boolean {
|
||||||
else -> false
|
else -> false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Event.isAttachmentMessage(): Boolean {
|
fun Event.isAttachmentMessage(): Boolean {
|
||||||
return getClearType() == EventType.MESSAGE
|
return getClearType() == EventType.MESSAGE
|
||||||
&& when (getClearContent()?.toModel<MessageContent>()?.msgType) {
|
&& when (getClearContent()?.toModel<MessageContent>()?.msgType) {
|
||||||
|
|
|
@ -21,10 +21,13 @@ package org.matrix.android.sdk.api.session.events.model
|
||||||
object RelationType {
|
object RelationType {
|
||||||
/** Lets you define an event which annotates an existing event.*/
|
/** Lets you define an event which annotates an existing event.*/
|
||||||
const val ANNOTATION = "m.annotation"
|
const val ANNOTATION = "m.annotation"
|
||||||
|
|
||||||
/** Lets you define an event which replaces an existing event.*/
|
/** Lets you define an event which replaces an existing event.*/
|
||||||
const val REPLACE = "m.replace"
|
const val REPLACE = "m.replace"
|
||||||
|
|
||||||
/** Lets you define an event which references an existing event.*/
|
/** Lets you define an event which references an existing event.*/
|
||||||
const val REFERENCE = "m.reference"
|
const val REFERENCE = "m.reference"
|
||||||
|
|
||||||
/** Lets you define an event which adds a response to an existing event.*/
|
/** Lets you define an event which adds a response to an existing event.*/
|
||||||
const val RESPONSE = "org.matrix.response"
|
const val RESPONSE = "org.matrix.response"
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,10 +33,12 @@ data class IntegrationManagerConfig(
|
||||||
* Defined in UserAccountData
|
* Defined in UserAccountData
|
||||||
*/
|
*/
|
||||||
ACCOUNT,
|
ACCOUNT,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defined in Wellknown
|
* Defined in Wellknown
|
||||||
*/
|
*/
|
||||||
HOMESERVER,
|
HOMESERVER,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fallback value, hardcoded by the SDK
|
* Fallback value, hardcoded by the SDK
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
package org.matrix.android.sdk.api.session.room.members
|
package org.matrix.android.sdk.api.session.room.members
|
||||||
|
|
||||||
sealed class ChangeMembershipState() {
|
sealed class ChangeMembershipState {
|
||||||
object Unknown : ChangeMembershipState()
|
object Unknown : ChangeMembershipState()
|
||||||
object Joining : ChangeMembershipState()
|
object Joining : ChangeMembershipState()
|
||||||
data class FailedJoining(val throwable: Throwable) : ChangeMembershipState()
|
data class FailedJoining(val throwable: Throwable) : ChangeMembershipState()
|
||||||
|
|
|
@ -33,6 +33,7 @@ data class RoomGuestAccessContent(
|
||||||
enum class GuestAccess(val value: String) {
|
enum class GuestAccess(val value: String) {
|
||||||
@Json(name = "can_join")
|
@Json(name = "can_join")
|
||||||
CanJoin("can_join"),
|
CanJoin("can_join"),
|
||||||
|
|
||||||
@Json(name = "forbidden")
|
@Json(name = "forbidden")
|
||||||
Forbidden("forbidden")
|
Forbidden("forbidden")
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,16 +29,19 @@ enum class RoomHistoryVisibility {
|
||||||
* participating homeserver with anyone, regardless of whether they have ever joined the room.
|
* participating homeserver with anyone, regardless of whether they have ever joined the room.
|
||||||
*/
|
*/
|
||||||
@Json(name = "world_readable") WORLD_READABLE,
|
@Json(name = "world_readable") WORLD_READABLE,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Previous events are always accessible to newly joined members. All events in the
|
* Previous events are always accessible to newly joined members. All events in the
|
||||||
* room are accessible, even those sent when the member was not a part of the room.
|
* room are accessible, even those sent when the member was not a part of the room.
|
||||||
*/
|
*/
|
||||||
@Json(name = "shared") SHARED,
|
@Json(name = "shared") SHARED,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Events are accessible to newly joined members from the point they were invited onwards.
|
* Events are accessible to newly joined members from the point they were invited onwards.
|
||||||
* Events stop being accessible when the member's state changes to something other than invite or join.
|
* Events stop being accessible when the member's state changes to something other than invite or join.
|
||||||
*/
|
*/
|
||||||
@Json(name = "invited") INVITED,
|
@Json(name = "invited") INVITED,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Events are accessible to newly joined members from the point they joined the room onwards.
|
* Events are accessible to newly joined members from the point they joined the room onwards.
|
||||||
* Events stop being accessible when the member's state changes to something other than join.
|
* Events stop being accessible when the member's state changes to something other than join.
|
||||||
|
|
|
@ -29,6 +29,7 @@ object MessageType {
|
||||||
const val MSGTYPE_RESPONSE = "org.matrix.response"
|
const val MSGTYPE_RESPONSE = "org.matrix.response"
|
||||||
const val MSGTYPE_POLL_CLOSED = "org.matrix.poll_closed"
|
const val MSGTYPE_POLL_CLOSED = "org.matrix.poll_closed"
|
||||||
const val MSGTYPE_VERIFICATION_REQUEST = "m.key.verification.request"
|
const val MSGTYPE_VERIFICATION_REQUEST = "m.key.verification.request"
|
||||||
|
|
||||||
// Add, in local, a fake message type in order to StickerMessage can inherit Message class
|
// Add, in local, a fake message type in order to StickerMessage can inherit Message class
|
||||||
// Because sticker isn't a message type but a event type without msgtype field
|
// Because sticker isn't a message type but a event type without msgtype field
|
||||||
const val MSGTYPE_STICKER_LOCAL = "org.matrix.android.sdk.sticker"
|
const val MSGTYPE_STICKER_LOCAL = "org.matrix.android.sdk.sticker"
|
||||||
|
|
|
@ -18,18 +18,25 @@ package org.matrix.android.sdk.api.session.room.send
|
||||||
|
|
||||||
enum class SendState {
|
enum class SendState {
|
||||||
UNKNOWN,
|
UNKNOWN,
|
||||||
|
|
||||||
// the event has not been sent
|
// the event has not been sent
|
||||||
UNSENT,
|
UNSENT,
|
||||||
|
|
||||||
// the event is encrypting
|
// the event is encrypting
|
||||||
ENCRYPTING,
|
ENCRYPTING,
|
||||||
|
|
||||||
// the event is currently sending
|
// the event is currently sending
|
||||||
SENDING,
|
SENDING,
|
||||||
|
|
||||||
// the event has been sent
|
// the event has been sent
|
||||||
SENT,
|
SENT,
|
||||||
|
|
||||||
// the event has been received from server
|
// the event has been received from server
|
||||||
SYNCED,
|
SYNCED,
|
||||||
|
|
||||||
// The event failed to be sent
|
// The event failed to be sent
|
||||||
UNDELIVERED,
|
UNDELIVERED,
|
||||||
|
|
||||||
// the event failed to be sent because some unknown devices have been found while encrypting it
|
// the event failed to be sent because some unknown devices have been found while encrypting it
|
||||||
FAILED_UNKNOWN_DEVICES;
|
FAILED_UNKNOWN_DEVICES;
|
||||||
|
|
||||||
|
|
|
@ -128,6 +128,7 @@ interface Timeline {
|
||||||
* It represents future events.
|
* It represents future events.
|
||||||
*/
|
*/
|
||||||
FORWARDS,
|
FORWARDS,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* It represents past events.
|
* It represents past events.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -20,6 +20,7 @@ interface FilterService {
|
||||||
|
|
||||||
enum class FilterPreset {
|
enum class FilterPreset {
|
||||||
NoFilter,
|
NoFilter,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter for Riot, will include only known event type
|
* Filter for Riot, will include only known event type
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -35,6 +35,7 @@ const val MXCRYPTO_ALGORITHM_MEGOLM_BACKUP = "m.megolm_backup.v1.curve25519-aes-
|
||||||
* Secured Shared Storage algorithm constant
|
* Secured Shared Storage algorithm constant
|
||||||
*/
|
*/
|
||||||
const val SSSS_ALGORITHM_CURVE25519_AES_SHA2 = "m.secret_storage.v1.curve25519-aes-sha2"
|
const val SSSS_ALGORITHM_CURVE25519_AES_SHA2 = "m.secret_storage.v1.curve25519-aes-sha2"
|
||||||
|
|
||||||
/* Secrets are encrypted using AES-CTR-256 and MACed using HMAC-SHA-256. **/
|
/* Secrets are encrypted using AES-CTR-256 and MACed using HMAC-SHA-256. **/
|
||||||
const val SSSS_ALGORITHM_AES_HMAC_SHA2 = "m.secret_storage.v1.aes-hmac-sha2"
|
const val SSSS_ALGORITHM_AES_HMAC_SHA2 = "m.secret_storage.v1.aes-hmac-sha2"
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@ enum class GossipingRequestState {
|
||||||
ACCEPTING,
|
ACCEPTING,
|
||||||
ACCEPTED,
|
ACCEPTED,
|
||||||
FAILED_TO_ACCEPTED,
|
FAILED_TO_ACCEPTED,
|
||||||
|
|
||||||
// USER_REJECTED,
|
// USER_REJECTED,
|
||||||
UNABLE_TO_PROCESS,
|
UNABLE_TO_PROCESS,
|
||||||
CANCELLED_BY_REQUESTER,
|
CANCELLED_BY_REQUESTER,
|
||||||
|
|
|
@ -36,6 +36,7 @@ import kotlin.math.min
|
||||||
object MXMegolmExportEncryption {
|
object MXMegolmExportEncryption {
|
||||||
private const val HEADER_LINE = "-----BEGIN MEGOLM SESSION DATA-----"
|
private const val HEADER_LINE = "-----BEGIN MEGOLM SESSION DATA-----"
|
||||||
private const val TRAILER_LINE = "-----END MEGOLM SESSION DATA-----"
|
private const val TRAILER_LINE = "-----END MEGOLM SESSION DATA-----"
|
||||||
|
|
||||||
// we split into lines before base64ing, because encodeBase64 doesn't deal
|
// we split into lines before base64ing, because encodeBase64 doesn't deal
|
||||||
// terribly well with large arrays.
|
// terribly well with large arrays.
|
||||||
private const val LINE_LENGTH = 72 * 4 / 3
|
private const val LINE_LENGTH = 72 * 4 / 3
|
||||||
|
|
|
@ -70,7 +70,9 @@ internal class OutgoingGossipingRequestManager @Inject constructor(
|
||||||
delay(1500)
|
delay(1500)
|
||||||
cryptoStore.getOrAddOutgoingSecretShareRequest(secretName, recipients)?.let {
|
cryptoStore.getOrAddOutgoingSecretShareRequest(secretName, recipients)?.let {
|
||||||
// TODO check if there is already one that is being sent?
|
// TODO check if there is already one that is being sent?
|
||||||
if (it.state == OutgoingGossipingRequestState.SENDING /**|| it.state == OutgoingGossipingRequestState.SENT*/) {
|
if (it.state == OutgoingGossipingRequestState.SENDING
|
||||||
|
/**|| it.state == OutgoingGossipingRequestState.SENT*/
|
||||||
|
) {
|
||||||
Timber.v("## CRYPTO - GOSSIP sendSecretShareRequest() : we are already sending for that session: $it")
|
Timber.v("## CRYPTO - GOSSIP sendSecretShareRequest() : we are already sending for that session: $it")
|
||||||
return@launch
|
return@launch
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,6 +80,7 @@ class OlmInboundGroupSessionWrapper2 : Serializable {
|
||||||
constructor() {
|
constructor() {
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new instance from the provided keys map.
|
* Create a new instance from the provided keys map.
|
||||||
*
|
*
|
||||||
|
|
|
@ -66,19 +66,23 @@ enum class WithHeldCode(val value: String) {
|
||||||
* the user/device was blacklisted
|
* the user/device was blacklisted
|
||||||
*/
|
*/
|
||||||
BLACKLISTED("m.blacklisted"),
|
BLACKLISTED("m.blacklisted"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the user/devices is unverified
|
* the user/devices is unverified
|
||||||
*/
|
*/
|
||||||
UNVERIFIED("m.unverified"),
|
UNVERIFIED("m.unverified"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the user/device is not allowed have the key. For example, this would usually be sent in response
|
* the user/device is not allowed have the key. For example, this would usually be sent in response
|
||||||
* to a key request if the user was not in the room when the message was sent
|
* to a key request if the user was not in the room when the message was sent
|
||||||
*/
|
*/
|
||||||
UNAUTHORISED("m.unauthorised"),
|
UNAUTHORISED("m.unauthorised"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sent in reply to a key request if the device that the key is requested from does not have the requested key
|
* Sent in reply to a key request if the device that the key is requested from does not have the requested key
|
||||||
*/
|
*/
|
||||||
UNAVAILABLE("m.unavailable"),
|
UNAVAILABLE("m.unavailable"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An olm session could not be established.
|
* An olm session could not be established.
|
||||||
* This may happen, for example, if the sender was unable to obtain a one-time key from the recipient.
|
* This may happen, for example, if the sender was unable to obtain a one-time key from the recipient.
|
||||||
|
|
|
@ -68,10 +68,13 @@ internal abstract class SASDefaultVerificationTransaction(
|
||||||
// Deprecated maybe removed later, use V2
|
// Deprecated maybe removed later, use V2
|
||||||
const val KEY_AGREEMENT_V1 = "curve25519"
|
const val KEY_AGREEMENT_V1 = "curve25519"
|
||||||
const val KEY_AGREEMENT_V2 = "curve25519-hkdf-sha256"
|
const val KEY_AGREEMENT_V2 = "curve25519-hkdf-sha256"
|
||||||
|
|
||||||
// ordered by preferred order
|
// ordered by preferred order
|
||||||
val KNOWN_AGREEMENT_PROTOCOLS = listOf(KEY_AGREEMENT_V2, KEY_AGREEMENT_V1)
|
val KNOWN_AGREEMENT_PROTOCOLS = listOf(KEY_AGREEMENT_V2, KEY_AGREEMENT_V1)
|
||||||
|
|
||||||
// ordered by preferred order
|
// ordered by preferred order
|
||||||
val KNOWN_HASHES = listOf("sha256")
|
val KNOWN_HASHES = listOf("sha256")
|
||||||
|
|
||||||
// ordered by preferred order
|
// ordered by preferred order
|
||||||
val KNOWN_MACS = listOf(SAS_MAC_SHA256, SAS_MAC_SHA256_LONGKDF)
|
val KNOWN_MACS = listOf(SAS_MAC_SHA256, SAS_MAC_SHA256_LONGKDF)
|
||||||
|
|
||||||
|
@ -101,6 +104,7 @@ internal abstract class SASDefaultVerificationTransaction(
|
||||||
|
|
||||||
// Visible for test
|
// Visible for test
|
||||||
var startReq: ValidVerificationInfoStart.SasVerificationInfoStart? = null
|
var startReq: ValidVerificationInfoStart.SasVerificationInfoStart? = null
|
||||||
|
|
||||||
// Visible for test
|
// Visible for test
|
||||||
var accepted: ValidVerificationInfoAccept? = null
|
var accepted: ValidVerificationInfoAccept? = null
|
||||||
protected var otherKey: String? = null
|
protected var otherKey: String? = null
|
||||||
|
|
|
@ -47,6 +47,7 @@ internal fun EventAnnotationsSummaryEntity.Companion.create(realm: Realm, roomId
|
||||||
}
|
}
|
||||||
return obj
|
return obj
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun EventAnnotationsSummaryEntity.Companion.getOrCreate(realm: Realm, roomId: String, eventId: String): EventAnnotationsSummaryEntity {
|
internal fun EventAnnotationsSummaryEntity.Companion.getOrCreate(realm: Realm, roomId: String, eventId: String): EventAnnotationsSummaryEntity {
|
||||||
return EventAnnotationsSummaryEntity.where(realm, eventId).findFirst()
|
return EventAnnotationsSummaryEntity.where(realm, eventId).findFirst()
|
||||||
?: EventAnnotationsSummaryEntity.create(realm, roomId, eventId).apply { this.roomId = roomId }
|
?: EventAnnotationsSummaryEntity.create(realm, roomId, eventId).apply { this.roomId = roomId }
|
||||||
|
|
|
@ -58,6 +58,7 @@ internal class TimelineEventDecryptor @Inject constructor(
|
||||||
|
|
||||||
// Set of eventIds which are currently decrypting
|
// Set of eventIds which are currently decrypting
|
||||||
private val existingRequests = mutableSetOf<DecryptionRequest>()
|
private val existingRequests = mutableSetOf<DecryptionRequest>()
|
||||||
|
|
||||||
// sessionId -> list of eventIds
|
// sessionId -> list of eventIds
|
||||||
private val unknownSessionsFailure = mutableMapOf<String, MutableSet<DecryptionRequest>>()
|
private val unknownSessionsFailure = mutableMapOf<String, MutableSet<DecryptionRequest>>()
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@ internal class DefaultTypingService @AssistedInject constructor(
|
||||||
|
|
||||||
// What the homeserver knows
|
// What the homeserver knows
|
||||||
private var userIsTyping = false
|
private var userIsTyping = false
|
||||||
|
|
||||||
// Last time the user is typing event has been sent
|
// Last time the user is typing event has been sent
|
||||||
private var lastRequestTimestamp: Long = 0
|
private var lastRequestTimestamp: Long = 0
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,7 @@ internal class DefaultWidgetPostAPIMediator @Inject constructor(private val mosh
|
||||||
Timber.d("BRIDGE onWidgetEvent : $jsonEventData")
|
Timber.d("BRIDGE onWidgetEvent : $jsonEventData")
|
||||||
try {
|
try {
|
||||||
val dataAsDict = jsonAdapter.fromJson(jsonEventData)
|
val dataAsDict = jsonAdapter.fromJson(jsonEventData)
|
||||||
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
val eventData = (dataAsDict?.get("event.data") as? JsonDict) ?: return
|
val eventData = (dataAsDict?.get("event.data") as? JsonDict) ?: return
|
||||||
onWidgetMessage(eventData)
|
onWidgetMessage(eventData)
|
||||||
|
|
|
@ -42,18 +42,25 @@ abstract class BottomSheetActionItem : VectorEpoxyModel<BottomSheetActionItem.Ho
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
@DrawableRes
|
@DrawableRes
|
||||||
var iconRes: Int = 0
|
var iconRes: Int = 0
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var textRes: Int = 0
|
var textRes: Int = 0
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var showExpand = false
|
var showExpand = false
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var expanded = false
|
var expanded = false
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var selected = false
|
var selected = false
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var subMenuItem = false
|
var subMenuItem = false
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var destructive = false
|
var destructive = false
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
lateinit var listener: View.OnClickListener
|
lateinit var listener: View.OnClickListener
|
||||||
|
|
||||||
|
|
|
@ -37,14 +37,19 @@ abstract class BottomSheetMessagePreviewItem : VectorEpoxyModel<BottomSheetMessa
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
lateinit var avatarRenderer: AvatarRenderer
|
lateinit var avatarRenderer: AvatarRenderer
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
lateinit var matrixItem: MatrixItem
|
lateinit var matrixItem: MatrixItem
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
lateinit var body: CharSequence
|
lateinit var body: CharSequence
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var time: CharSequence? = null
|
var time: CharSequence? = null
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var movementMethod: MovementMethod? = null
|
var movementMethod: MovementMethod? = null
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var userClicked: (() -> Unit)? = null
|
var userClicked: (() -> Unit)? = null
|
||||||
|
|
||||||
|
|
|
@ -33,10 +33,13 @@ abstract class BottomSheetQuickReactionsItem : VectorEpoxyModel<BottomSheetQuick
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
lateinit var fontProvider: EmojiCompatFontProvider
|
lateinit var fontProvider: EmojiCompatFontProvider
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
lateinit var texts: List<String>
|
lateinit var texts: List<String>
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
lateinit var selecteds: List<Boolean>
|
lateinit var selecteds: List<Boolean>
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var listener: Listener? = null
|
var listener: Listener? = null
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,10 @@ abstract class BottomSheetSendStateItem : VectorEpoxyModel<BottomSheetSendStateI
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var showProgress: Boolean = false
|
var showProgress: Boolean = false
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
lateinit var text: CharSequence
|
lateinit var text: CharSequence
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
@DrawableRes
|
@DrawableRes
|
||||||
var drawableStart: Int = 0
|
var drawableStart: Int = 0
|
||||||
|
|
|
@ -30,6 +30,7 @@ abstract class BaseProfileMatrixItem<T : ProfileMatrixItem.Holder> : VectorEpoxy
|
||||||
@EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer
|
@EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer
|
||||||
@EpoxyAttribute lateinit var matrixItem: MatrixItem
|
@EpoxyAttribute lateinit var matrixItem: MatrixItem
|
||||||
@EpoxyAttribute var editable: Boolean = true
|
@EpoxyAttribute var editable: Boolean = true
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var userEncryptionTrustLevel: RoomEncryptionTrustLevel? = null
|
var userEncryptionTrustLevel: RoomEncryptionTrustLevel? = null
|
||||||
@EpoxyAttribute var clickListener: View.OnClickListener? = null
|
@EpoxyAttribute var clickListener: View.OnClickListener? = null
|
||||||
|
|
|
@ -38,6 +38,7 @@ abstract class ProfileActionItem : VectorEpoxyModel<ProfileActionItem.Holder>()
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
lateinit var title: String
|
lateinit var title: String
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var subtitle: String? = null
|
var subtitle: String? = null
|
||||||
|
|
||||||
|
|
|
@ -26,11 +26,11 @@ class CheckableFrameLayout : FrameLayout, Checkable {
|
||||||
|
|
||||||
private var mChecked = false
|
private var mChecked = false
|
||||||
|
|
||||||
constructor(context: Context) : super(context) {}
|
constructor(context: Context) : super(context)
|
||||||
|
|
||||||
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {}
|
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
|
||||||
|
|
||||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {}
|
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr)
|
||||||
|
|
||||||
override fun isChecked(): Boolean {
|
override fun isChecked(): Boolean {
|
||||||
return mChecked
|
return mChecked
|
||||||
|
|
|
@ -29,6 +29,7 @@ class DrawableProvider @Inject constructor(private val context: Context) {
|
||||||
fun getDrawable(@DrawableRes colorRes: Int): Drawable? {
|
fun getDrawable(@DrawableRes colorRes: Int): Drawable? {
|
||||||
return ContextCompat.getDrawable(context, colorRes)
|
return ContextCompat.getDrawable(context, colorRes)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getDrawable(@DrawableRes colorRes: Int, @ColorInt color: Int): Drawable? {
|
fun getDrawable(@DrawableRes colorRes: Int, @ColorInt color: Int): Drawable? {
|
||||||
return ContextCompat.getDrawable(context, colorRes)?.let {
|
return ContextCompat.getDrawable(context, colorRes)?.let {
|
||||||
ThemeUtils.tintDrawableWithColor(it, color)
|
ThemeUtils.tintDrawableWithColor(it, color)
|
||||||
|
|
|
@ -56,15 +56,19 @@ class PasswordStrengthBar @JvmOverloads constructor(
|
||||||
@BindColor(R.color.password_strength_bar_undefined)
|
@BindColor(R.color.password_strength_bar_undefined)
|
||||||
@JvmField
|
@JvmField
|
||||||
var colorBackground: Int = 0
|
var colorBackground: Int = 0
|
||||||
|
|
||||||
@BindColor(R.color.password_strength_bar_weak)
|
@BindColor(R.color.password_strength_bar_weak)
|
||||||
@JvmField
|
@JvmField
|
||||||
var colorWeak: Int = 0
|
var colorWeak: Int = 0
|
||||||
|
|
||||||
@BindColor(R.color.password_strength_bar_low)
|
@BindColor(R.color.password_strength_bar_low)
|
||||||
@JvmField
|
@JvmField
|
||||||
var colorLow: Int = 0
|
var colorLow: Int = 0
|
||||||
|
|
||||||
@BindColor(R.color.password_strength_bar_ok)
|
@BindColor(R.color.password_strength_bar_ok)
|
||||||
@JvmField
|
@JvmField
|
||||||
var colorOk: Int = 0
|
var colorOk: Int = 0
|
||||||
|
|
||||||
@BindColor(R.color.password_strength_bar_strong)
|
@BindColor(R.color.password_strength_bar_strong)
|
||||||
@JvmField
|
@JvmField
|
||||||
var colorStrong: Int = 0
|
var colorStrong: Int = 0
|
||||||
|
|
|
@ -55,8 +55,10 @@ abstract class AttachmentPreviewItem<H : AttachmentPreviewItem.Holder> : VectorE
|
||||||
abstract class AttachmentMiniaturePreviewItem : AttachmentPreviewItem<AttachmentMiniaturePreviewItem.Holder>() {
|
abstract class AttachmentMiniaturePreviewItem : AttachmentPreviewItem<AttachmentMiniaturePreviewItem.Holder>() {
|
||||||
|
|
||||||
@EpoxyAttribute override lateinit var attachment: ContentAttachmentData
|
@EpoxyAttribute override lateinit var attachment: ContentAttachmentData
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var clickListener: View.OnClickListener? = null
|
var clickListener: View.OnClickListener? = null
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var checked: Boolean = false
|
var checked: Boolean = false
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,7 @@ abstract class RecyclerViewPresenter<T>(context: Context?) : AutocompletePresent
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onViewShown() {}
|
override fun onViewShown() {}
|
||||||
|
|
||||||
@CallSuper
|
@CallSuper
|
||||||
override fun onViewHidden() {
|
override fun onViewHidden() {
|
||||||
observer?.also {
|
observer?.also {
|
||||||
|
|
|
@ -29,10 +29,13 @@ abstract class AutocompleteCommandItem : VectorEpoxyModel<AutocompleteCommandIte
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var name: CharSequence? = null
|
var name: CharSequence? = null
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var parameters: CharSequence? = null
|
var parameters: CharSequence? = null
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var description: CharSequence? = null
|
var description: CharSequence? = null
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var clickListener: View.OnClickListener? = null
|
var clickListener: View.OnClickListener? = null
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,7 @@ class WebRtcPeerConnectionManager @Inject constructor(
|
||||||
|
|
||||||
fun addIfNeeded(renderer: SurfaceViewRenderer?, list: MutableList<WeakReference<SurfaceViewRenderer>>) {
|
fun addIfNeeded(renderer: SurfaceViewRenderer?, list: MutableList<WeakReference<SurfaceViewRenderer>>) {
|
||||||
if (renderer == null) return
|
if (renderer == null) return
|
||||||
val exists = list.firstOrNull() {
|
val exists = list.firstOrNull {
|
||||||
it.get() == renderer
|
it.get() == renderer
|
||||||
} != null
|
} != null
|
||||||
if (!exists) {
|
if (!exists) {
|
||||||
|
|
|
@ -32,6 +32,7 @@ class KeysBackupRestoreSuccessFragment @Inject constructor() : VectorBaseFragmen
|
||||||
|
|
||||||
@BindView(R.id.keys_backup_restore_success)
|
@BindView(R.id.keys_backup_restore_success)
|
||||||
lateinit var mSuccessText: TextView
|
lateinit var mSuccessText: TextView
|
||||||
|
|
||||||
@BindView(R.id.keys_backup_restore_success_info)
|
@BindView(R.id.keys_backup_restore_success_info)
|
||||||
lateinit var mSuccessDetailsText: TextView
|
lateinit var mSuccessDetailsText: TextView
|
||||||
|
|
||||||
|
|
|
@ -38,12 +38,16 @@ abstract class BottomSheetVerificationActionItem : VectorEpoxyModel<BottomSheetV
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
@DrawableRes
|
@DrawableRes
|
||||||
var iconRes: Int = -1
|
var iconRes: Int = -1
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var title: CharSequence = ""
|
var title: CharSequence = ""
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var subTitle: CharSequence? = null
|
var subTitle: CharSequence? = null
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var titleColor: Int = 0
|
var titleColor: Int = 0
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var iconColor: Int = -1
|
var iconColor: Int = -1
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,7 @@ sealed class RoomDetailViewEvents : VectorViewEvents {
|
||||||
data class SlashCommandHandled(@StringRes val messageRes: Int? = null) : SendMessageResult()
|
data class SlashCommandHandled(@StringRes val messageRes: Int? = null) : SendMessageResult()
|
||||||
object SlashCommandResultOk : SendMessageResult()
|
object SlashCommandResultOk : SendMessageResult()
|
||||||
class SlashCommandResultError(val throwable: Throwable) : SendMessageResult()
|
class SlashCommandResultError(val throwable: Throwable) : SendMessageResult()
|
||||||
|
|
||||||
// TODO Remove
|
// TODO Remove
|
||||||
object SlashCommandNotImplemented : SendMessageResult()
|
object SlashCommandNotImplemented : SendMessageResult()
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@ sealed class SendMode(open val text: String) {
|
||||||
// This is necessary for forcing refresh on selectSubscribe
|
// This is necessary for forcing refresh on selectSubscribe
|
||||||
private val ts: Long = System.currentTimeMillis()
|
private val ts: Long = System.currentTimeMillis()
|
||||||
) : SendMode(text)
|
) : SendMode(text)
|
||||||
|
|
||||||
data class QUOTE(val timelineEvent: TimelineEvent, override val text: String) : SendMode(text)
|
data class QUOTE(val timelineEvent: TimelineEvent, override val text: String) : SendMode(text)
|
||||||
data class EDIT(val timelineEvent: TimelineEvent, override val text: String) : SendMode(text)
|
data class EDIT(val timelineEvent: TimelineEvent, override val text: String) : SendMode(text)
|
||||||
data class REPLY(val timelineEvent: TimelineEvent, override val text: String) : SendMode(text)
|
data class REPLY(val timelineEvent: TimelineEvent, override val text: String) : SendMode(text)
|
||||||
|
|
|
@ -54,18 +54,25 @@ class TextComposerView @JvmOverloads constructor(context: Context, attrs: Attrib
|
||||||
|
|
||||||
@BindView(R.id.composer_related_message_sender)
|
@BindView(R.id.composer_related_message_sender)
|
||||||
lateinit var composerRelatedMessageTitle: TextView
|
lateinit var composerRelatedMessageTitle: TextView
|
||||||
|
|
||||||
@BindView(R.id.composer_related_message_preview)
|
@BindView(R.id.composer_related_message_preview)
|
||||||
lateinit var composerRelatedMessageContent: TextView
|
lateinit var composerRelatedMessageContent: TextView
|
||||||
|
|
||||||
@BindView(R.id.composer_related_message_avatar_view)
|
@BindView(R.id.composer_related_message_avatar_view)
|
||||||
lateinit var composerRelatedMessageAvatar: ImageView
|
lateinit var composerRelatedMessageAvatar: ImageView
|
||||||
|
|
||||||
@BindView(R.id.composer_related_message_action_image)
|
@BindView(R.id.composer_related_message_action_image)
|
||||||
lateinit var composerRelatedMessageActionIcon: ImageView
|
lateinit var composerRelatedMessageActionIcon: ImageView
|
||||||
|
|
||||||
@BindView(R.id.composer_related_message_close)
|
@BindView(R.id.composer_related_message_close)
|
||||||
lateinit var composerRelatedMessageCloseButton: ImageButton
|
lateinit var composerRelatedMessageCloseButton: ImageButton
|
||||||
|
|
||||||
@BindView(R.id.composerEditText)
|
@BindView(R.id.composerEditText)
|
||||||
lateinit var composerEditText: ComposerEditText
|
lateinit var composerEditText: ComposerEditText
|
||||||
|
|
||||||
@BindView(R.id.composer_avatar_view)
|
@BindView(R.id.composer_avatar_view)
|
||||||
lateinit var composerAvatarImageView: ImageView
|
lateinit var composerAvatarImageView: ImageView
|
||||||
|
|
||||||
@BindView(R.id.composer_shield)
|
@BindView(R.id.composer_shield)
|
||||||
lateinit var composerShieldImageView: ImageView
|
lateinit var composerShieldImageView: ImageView
|
||||||
|
|
||||||
|
|
|
@ -136,8 +136,10 @@ abstract class AbsBaseMessageItem<H : AbsBaseMessageItem.Holder> : BaseEventItem
|
||||||
val messageColorProvider: MessageColorProvider
|
val messageColorProvider: MessageColorProvider
|
||||||
val itemLongClickListener: View.OnLongClickListener?
|
val itemLongClickListener: View.OnLongClickListener?
|
||||||
val itemClickListener: View.OnClickListener?
|
val itemClickListener: View.OnClickListener?
|
||||||
|
|
||||||
// val memberClickListener: View.OnClickListener?
|
// val memberClickListener: View.OnClickListener?
|
||||||
val reactionPillCallback: TimelineEventController.ReactionPillCallback?
|
val reactionPillCallback: TimelineEventController.ReactionPillCallback?
|
||||||
|
|
||||||
// val avatarCallback: TimelineEventController.AvatarCallback?
|
// val avatarCallback: TimelineEventController.AvatarCallback?
|
||||||
val readReceiptsCallback: TimelineEventController.ReadReceiptsCallback?
|
val readReceiptsCallback: TimelineEventController.ReadReceiptsCallback?
|
||||||
// val emojiTypeFace: Typeface?
|
// val emojiTypeFace: Typeface?
|
||||||
|
|
|
@ -37,6 +37,7 @@ abstract class BaseEventItem<H : BaseEventItem.BaseHolder> : VectorEpoxyModel<H>
|
||||||
// To use for instance when opening a permalink with an eventId
|
// To use for instance when opening a permalink with an eventId
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var highlighted: Boolean = false
|
var highlighted: Boolean = false
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
open var leftGuideline: Int = 0
|
open var leftGuideline: Int = 0
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@ abstract class MessageBlockCodeItem : AbsMessageItem<MessageBlockCodeItem.Holder
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var message: CharSequence? = null
|
var message: CharSequence? = null
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var editedSpan: CharSequence? = null
|
var editedSpan: CharSequence? = null
|
||||||
|
|
||||||
|
|
|
@ -35,14 +35,19 @@ abstract class MessageImageVideoItem : AbsMessageItem<MessageImageVideoItem.Hold
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
lateinit var mediaData: ImageContentRenderer.Data
|
lateinit var mediaData: ImageContentRenderer.Data
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var playable: Boolean = false
|
var playable: Boolean = false
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var mode = ImageContentRenderer.Mode.THUMBNAIL
|
var mode = ImageContentRenderer.Mode.THUMBNAIL
|
||||||
|
|
||||||
@EpoxyAttribute(EpoxyAttribute.Option.DoNotHash)
|
@EpoxyAttribute(EpoxyAttribute.Option.DoNotHash)
|
||||||
var clickListener: View.OnClickListener? = null
|
var clickListener: View.OnClickListener? = null
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
lateinit var imageContentRenderer: ImageContentRenderer
|
lateinit var imageContentRenderer: ImageContentRenderer
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
lateinit var contentUploadStateTrackerBinder: ContentUploadStateTrackerBinder
|
lateinit var contentUploadStateTrackerBinder: ContentUploadStateTrackerBinder
|
||||||
|
|
||||||
|
|
|
@ -30,10 +30,13 @@ abstract class MessageTextItem : AbsMessageItem<MessageTextItem.Holder>() {
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var searchForPills: Boolean = false
|
var searchForPills: Boolean = false
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var message: CharSequence? = null
|
var message: CharSequence? = null
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var useBigFont: Boolean = false
|
var useBigFont: Boolean = false
|
||||||
|
|
||||||
@EpoxyAttribute(EpoxyAttribute.Option.DoNotHash)
|
@EpoxyAttribute(EpoxyAttribute.Option.DoNotHash)
|
||||||
var movementMethod: MovementMethod? = null
|
var movementMethod: MovementMethod? = null
|
||||||
|
|
||||||
|
|
|
@ -32,10 +32,13 @@ abstract class ReactionInfoSimpleItem : EpoxyModelWithHolder<ReactionInfoSimpleI
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
lateinit var reactionKey: CharSequence
|
lateinit var reactionKey: CharSequence
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
lateinit var authorDisplayName: CharSequence
|
lateinit var authorDisplayName: CharSequence
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var timeStamp: CharSequence? = null
|
var timeStamp: CharSequence? = null
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var userClicked: (() -> Unit)? = null
|
var userClicked: (() -> Unit)? = null
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ abstract class RoomWidgetItem : EpoxyModelWithHolder<RoomWidgetItem.Holder>() {
|
||||||
|
|
||||||
@EpoxyAttribute lateinit var widget: Widget
|
@EpoxyAttribute lateinit var widget: Widget
|
||||||
@EpoxyAttribute var widgetClicked: ClickListener? = null
|
@EpoxyAttribute var widgetClicked: ClickListener? = null
|
||||||
|
|
||||||
@DrawableRes
|
@DrawableRes
|
||||||
@EpoxyAttribute var iconRes: Int? = null
|
@EpoxyAttribute var iconRes: Int? = null
|
||||||
|
|
||||||
|
|
|
@ -158,10 +158,10 @@ class RoomListViewModel @Inject constructor(initialState: RoomListViewState,
|
||||||
private fun handleMarkAllRoomsRead() = withState { state ->
|
private fun handleMarkAllRoomsRead() = withState { state ->
|
||||||
state.asyncFilteredRooms.invoke()
|
state.asyncFilteredRooms.invoke()
|
||||||
?.flatMap { it.value }
|
?.flatMap { it.value }
|
||||||
?.filter { it.membership == Membership.JOIN }
|
.filter { it.membership == Membership.JOIN }
|
||||||
?.map { it.roomId }
|
.map { it.roomId }
|
||||||
?.toList()
|
.toList()
|
||||||
?.let { session.markAllAsRead(it, NoOpMatrixCallback()) }
|
.let { session.markAllAsRead(it, NoOpMatrixCallback()) }
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handleChangeNotificationMode(action: RoomListAction.ChangeRoomNotificationState) {
|
private fun handleChangeNotificationMode(action: RoomListAction.ChangeRoomNotificationState) {
|
||||||
|
|
|
@ -67,8 +67,8 @@ data class RoomListViewState(
|
||||||
val hasUnread: Boolean
|
val hasUnread: Boolean
|
||||||
get() = asyncFilteredRooms.invoke()
|
get() = asyncFilteredRooms.invoke()
|
||||||
?.flatMap { it.value }
|
?.flatMap { it.value }
|
||||||
?.filter { it.membership == Membership.JOIN }
|
.filter { it.membership == Membership.JOIN }
|
||||||
?.any { it.hasUnreadMessages }
|
.any { it.hasUnreadMessages }
|
||||||
?: false
|
?: false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,8 +42,10 @@ abstract class RoomSummaryItem : VectorEpoxyModel<RoomSummaryItem.Holder>() {
|
||||||
@EpoxyAttribute lateinit var typingMessage: CharSequence
|
@EpoxyAttribute lateinit var typingMessage: CharSequence
|
||||||
@EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer
|
@EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer
|
||||||
@EpoxyAttribute lateinit var matrixItem: MatrixItem
|
@EpoxyAttribute lateinit var matrixItem: MatrixItem
|
||||||
|
|
||||||
// Used only for diff calculation
|
// Used only for diff calculation
|
||||||
@EpoxyAttribute lateinit var lastEvent: String
|
@EpoxyAttribute lateinit var lastEvent: String
|
||||||
|
|
||||||
// We use DoNotHash here as Spans are not implementing equals/hashcode
|
// We use DoNotHash here as Spans are not implementing equals/hashcode
|
||||||
@EpoxyAttribute(EpoxyAttribute.Option.DoNotHash) lateinit var lastFormattedEvent: CharSequence
|
@EpoxyAttribute(EpoxyAttribute.Option.DoNotHash) lateinit var lastFormattedEvent: CharSequence
|
||||||
@EpoxyAttribute lateinit var lastEventTime: CharSequence
|
@EpoxyAttribute lateinit var lastEventTime: CharSequence
|
||||||
|
|
|
@ -39,6 +39,7 @@ sealed class LoginAction : VectorViewModelAction {
|
||||||
|
|
||||||
data class AddThreePid(val threePid: RegisterThreePid) : RegisterAction()
|
data class AddThreePid(val threePid: RegisterThreePid) : RegisterAction()
|
||||||
object SendAgainThreePid : RegisterAction()
|
object SendAgainThreePid : RegisterAction()
|
||||||
|
|
||||||
// TODO Confirm Email (from link in the email, open in the phone, intercepted by RiotX)
|
// TODO Confirm Email (from link in the email, open in the phone, intercepted by RiotX)
|
||||||
data class ValidateThreePid(val code: String) : RegisterAction()
|
data class ValidateThreePid(val code: String) : RegisterAction()
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,13 @@ package im.vector.app.features.login
|
||||||
|
|
||||||
enum class SignMode {
|
enum class SignMode {
|
||||||
Unknown,
|
Unknown,
|
||||||
|
|
||||||
// Account creation
|
// Account creation
|
||||||
SignUp,
|
SignUp,
|
||||||
|
|
||||||
// Login
|
// Login
|
||||||
SignIn,
|
SignIn,
|
||||||
|
|
||||||
// Login directly with matrix Id
|
// Login directly with matrix Id
|
||||||
SignInWithMatrixId
|
SignInWithMatrixId
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,7 @@ interface AttachmentData : Parcelable {
|
||||||
val mimeType: String?
|
val mimeType: String?
|
||||||
val url: String?
|
val url: String?
|
||||||
val elementToDecrypt: ElementToDecrypt?
|
val elementToDecrypt: ElementToDecrypt?
|
||||||
|
|
||||||
// If true will load non mxc url, be careful to set it only for attachments sent by you
|
// If true will load non mxc url, be careful to set it only for attachments sent by you
|
||||||
val allowNonMxcUrls: Boolean
|
val allowNonMxcUrls: Boolean
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,12 +29,15 @@ interface NotifiableEvent : Serializable {
|
||||||
val description: String?
|
val description: String?
|
||||||
val type: String?
|
val type: String?
|
||||||
val timestamp: Long
|
val timestamp: Long
|
||||||
|
|
||||||
// NotificationCompat.VISIBILITY_PUBLIC , VISIBILITY_PRIVATE , VISIBILITY_SECRET
|
// NotificationCompat.VISIBILITY_PUBLIC , VISIBILITY_PRIVATE , VISIBILITY_SECRET
|
||||||
var lockScreenVisibility: Int
|
var lockScreenVisibility: Int
|
||||||
|
|
||||||
// Compat: Only for android <7, for newer version the sound is defined in the channel
|
// Compat: Only for android <7, for newer version the sound is defined in the channel
|
||||||
var soundName: String?
|
var soundName: String?
|
||||||
var hasBeenDisplayed: Boolean
|
var hasBeenDisplayed: Boolean
|
||||||
var isRedacted: Boolean
|
var isRedacted: Boolean
|
||||||
|
|
||||||
// Used to know if event should be replaced with the one coming from eventstream
|
// Used to know if event should be replaced with the one coming from eventstream
|
||||||
var isPushGatewayEvent: Boolean
|
var isPushGatewayEvent: Boolean
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ data class RoomEventGroupInfo(
|
||||||
) {
|
) {
|
||||||
// An event in the list has not yet been display
|
// An event in the list has not yet been display
|
||||||
var hasNewEvent: Boolean = false
|
var hasNewEvent: Boolean = false
|
||||||
|
|
||||||
// true if at least one on the not yet displayed event is noisy
|
// true if at least one on the not yet displayed event is noisy
|
||||||
var shouldBing: Boolean = false
|
var shouldBing: Boolean = false
|
||||||
var customSound: String? = null
|
var customSound: String? = null
|
||||||
|
|
|
@ -23,6 +23,7 @@ enum class JoinState {
|
||||||
NOT_JOINED,
|
NOT_JOINED,
|
||||||
JOINING,
|
JOINING,
|
||||||
JOINING_ERROR,
|
JOINING_ERROR,
|
||||||
|
|
||||||
// Room is joined and this is confirmed by the sync
|
// Room is joined and this is confirmed by the sync
|
||||||
JOINED
|
JOINED
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,12 +51,16 @@ class NotificationTroubleshootRecyclerViewAdapter(val tests: ArrayList<Troublesh
|
||||||
|
|
||||||
@BindView(R.id.troubleshootTestTitle)
|
@BindView(R.id.troubleshootTestTitle)
|
||||||
lateinit var titleText: TextView
|
lateinit var titleText: TextView
|
||||||
|
|
||||||
@BindView(R.id.troubleshootTestDescription)
|
@BindView(R.id.troubleshootTestDescription)
|
||||||
lateinit var descriptionText: TextView
|
lateinit var descriptionText: TextView
|
||||||
|
|
||||||
@BindView(R.id.troubleshootStatusIcon)
|
@BindView(R.id.troubleshootStatusIcon)
|
||||||
lateinit var statusIconImage: ImageView
|
lateinit var statusIconImage: ImageView
|
||||||
|
|
||||||
@BindView(R.id.troubleshootProgressBar)
|
@BindView(R.id.troubleshootProgressBar)
|
||||||
lateinit var progressBar: ProgressBar
|
lateinit var progressBar: ProgressBar
|
||||||
|
|
||||||
@BindView(R.id.troubleshootTestButton)
|
@BindView(R.id.troubleshootTestButton)
|
||||||
lateinit var fixButton: Button
|
lateinit var fixButton: Button
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue