ktlint: fix (no-empty-first-line-in-method-block) issues
This commit is contained in:
parent
e5779d425a
commit
fbb23dfb66
@ -29,3 +29,4 @@ disabled_rules=no-wildcard-imports,no-multi-spaces,colon-spacing,chain-wrapping,
|
|||||||
# no-semi
|
# no-semi
|
||||||
# no-empty-class-body
|
# no-empty-class-body
|
||||||
# experimental:multiline-if-else
|
# experimental:multiline-if-else
|
||||||
|
# experimental:no-empty-first-line-in-method-block
|
||||||
|
@ -98,7 +98,6 @@ internal class DefaultAuthenticator @Inject constructor(@Unauthenticated
|
|||||||
private suspend fun authenticate(homeServerConnectionConfig: HomeServerConnectionConfig,
|
private suspend fun authenticate(homeServerConnectionConfig: HomeServerConnectionConfig,
|
||||||
login: String,
|
login: String,
|
||||||
password: String) = withContext(coroutineDispatchers.io) {
|
password: String) = withContext(coroutineDispatchers.io) {
|
||||||
|
|
||||||
val authAPI = buildAuthAPI(homeServerConnectionConfig)
|
val authAPI = buildAuthAPI(homeServerConnectionConfig)
|
||||||
val loginParams = if (Patterns.EMAIL_ADDRESS.matcher(login).matches()) {
|
val loginParams = if (Patterns.EMAIL_ADDRESS.matcher(login).matches()) {
|
||||||
PasswordLoginParams.thirdPartyIdentifier(ThreePidMedium.EMAIL, login, password, "Mobile")
|
PasswordLoginParams.thirdPartyIdentifier(ThreePidMedium.EMAIL, login, password, "Mobile")
|
||||||
|
@ -234,7 +234,6 @@ internal class MXOlmDevice @Inject constructor(
|
|||||||
* @return {{payload: string, session_id: string}} decrypted payload, and session id of new session.
|
* @return {{payload: string, session_id: string}} decrypted payload, and session id of new session.
|
||||||
*/
|
*/
|
||||||
fun createInboundSession(theirDeviceIdentityKey: String, messageType: Int, ciphertext: String): Map<String, String>? {
|
fun createInboundSession(theirDeviceIdentityKey: String, messageType: Int, ciphertext: String): Map<String, String>? {
|
||||||
|
|
||||||
Timber.v("## createInboundSession() : theirIdentityKey: $theirDeviceIdentityKey")
|
Timber.v("## createInboundSession() : theirIdentityKey: $theirDeviceIdentityKey")
|
||||||
|
|
||||||
var olmSession: OlmSession? = null
|
var olmSession: OlmSession? = null
|
||||||
@ -555,7 +554,6 @@ internal class MXOlmDevice @Inject constructor(
|
|||||||
val sessions = ArrayList<OlmInboundGroupSessionWrapper>(megolmSessionsData.size)
|
val sessions = ArrayList<OlmInboundGroupSessionWrapper>(megolmSessionsData.size)
|
||||||
|
|
||||||
for (megolmSessionData in megolmSessionsData) {
|
for (megolmSessionData in megolmSessionsData) {
|
||||||
|
|
||||||
val sessionId = megolmSessionData.sessionId
|
val sessionId = megolmSessionData.sessionId
|
||||||
val senderKey = megolmSessionData.senderKey
|
val senderKey = megolmSessionData.senderKey
|
||||||
val roomId = megolmSessionData.roomId
|
val roomId = megolmSessionData.roomId
|
||||||
|
@ -982,7 +982,6 @@ internal class KeysBackup @Inject constructor(
|
|||||||
keysBackupStateManager.state = KeysBackupState.Disabled
|
keysBackupStateManager.state = KeysBackupState.Disabled
|
||||||
} else {
|
} else {
|
||||||
getKeysBackupTrust(keyBackupVersion, object : MatrixCallback<KeysBackupVersionTrust> {
|
getKeysBackupTrust(keyBackupVersion, object : MatrixCallback<KeysBackupVersionTrust> {
|
||||||
|
|
||||||
override fun onSuccess(data: KeysBackupVersionTrust) {
|
override fun onSuccess(data: KeysBackupVersionTrust) {
|
||||||
val versionInStore = cryptoStore.getKeyBackupVersion()
|
val versionInStore = cryptoStore.getKeyBackupVersion()
|
||||||
|
|
||||||
|
@ -111,7 +111,6 @@ internal fun ChunkEntity.add(roomId: String,
|
|||||||
direction: PaginationDirection,
|
direction: PaginationDirection,
|
||||||
stateIndexOffset: Int = 0,
|
stateIndexOffset: Int = 0,
|
||||||
isUnlinked: Boolean = false) {
|
isUnlinked: Boolean = false) {
|
||||||
|
|
||||||
assertIsManaged()
|
assertIsManaged()
|
||||||
if (event.eventId != null && timelineEvents.find(event.eventId) != null) {
|
if (event.eventId != null && timelineEvents.find(event.eventId) != null) {
|
||||||
return
|
return
|
||||||
|
@ -24,7 +24,6 @@ import im.vector.matrix.android.internal.session.pushers.JsonPusher
|
|||||||
internal object PushersMapper {
|
internal object PushersMapper {
|
||||||
|
|
||||||
fun map(pushEntity: PusherEntity): Pusher {
|
fun map(pushEntity: PusherEntity): Pusher {
|
||||||
|
|
||||||
return Pusher(
|
return Pusher(
|
||||||
pushKey = pushEntity.pushKey,
|
pushKey = pushEntity.pushKey,
|
||||||
kind = pushEntity.kind ?: "",
|
kind = pushEntity.kind ?: "",
|
||||||
|
@ -63,7 +63,6 @@ internal fun TimelineEventEntity.Companion.latestEvent(realm: Realm,
|
|||||||
includesSending: Boolean,
|
includesSending: Boolean,
|
||||||
includedTypes: List<String> = emptyList(),
|
includedTypes: List<String> = emptyList(),
|
||||||
excludedTypes: List<String> = emptyList()): TimelineEventEntity? {
|
excludedTypes: List<String> = emptyList()): TimelineEventEntity? {
|
||||||
|
|
||||||
val roomEntity = RoomEntity.where(realm, roomId).findFirst() ?: return null
|
val roomEntity = RoomEntity.where(realm, roomId).findFirst() ?: return null
|
||||||
val eventList = if (includesSending && roomEntity.sendingTimelineEvents.isNotEmpty()) {
|
val eventList = if (includesSending && roomEntity.sendingTimelineEvents.isNotEmpty()) {
|
||||||
roomEntity.sendingTimelineEvents
|
roomEntity.sendingTimelineEvents
|
||||||
@ -117,7 +116,6 @@ internal fun TimelineEventEntity.Companion.findAllInRoomWithSendStates(realm: Re
|
|||||||
roomId: String,
|
roomId: String,
|
||||||
sendStates: List<SendState>)
|
sendStates: List<SendState>)
|
||||||
: RealmResults<TimelineEventEntity> {
|
: RealmResults<TimelineEventEntity> {
|
||||||
|
|
||||||
val sendStatesStr = sendStates.map { it.name }.toTypedArray()
|
val sendStatesStr = sendStates.map { it.name }.toTypedArray()
|
||||||
return realm.where<TimelineEventEntity>()
|
return realm.where<TimelineEventEntity>()
|
||||||
.equalTo(TimelineEventEntityFields.ROOM_ID, roomId)
|
.equalTo(TimelineEventEntityFields.ROOM_ID, roomId)
|
||||||
|
@ -58,7 +58,6 @@ internal class DefaultContentUrlResolver @Inject constructor(private val homeSer
|
|||||||
contentUrl: String,
|
contentUrl: String,
|
||||||
prefix: String,
|
prefix: String,
|
||||||
params: String? = null): String? {
|
params: String? = null): String? {
|
||||||
|
|
||||||
var serverAndMediaId = contentUrl.removePrefix(MATRIX_CONTENT_URI_SCHEME)
|
var serverAndMediaId = contentUrl.removePrefix(MATRIX_CONTENT_URI_SCHEME)
|
||||||
val fragmentOffset = serverAndMediaId.indexOf("#")
|
val fragmentOffset = serverAndMediaId.indexOf("#")
|
||||||
var fragment = ""
|
var fragment = ""
|
||||||
|
@ -55,7 +55,6 @@ internal object FilterUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
filterBody.room?.let { room ->
|
filterBody.room?.let { room ->
|
||||||
room.ephemeral?.types?.remove("m.receipt")
|
room.ephemeral?.types?.remove("m.receipt")
|
||||||
if (room.ephemeral?.types?.isEmpty() == true) {
|
if (room.ephemeral?.types?.isEmpty() == true) {
|
||||||
|
@ -44,7 +44,6 @@ internal class AddHttpPusherWorker(context: Context, params: WorkerParameters)
|
|||||||
@Inject lateinit var monarchy: Monarchy
|
@Inject lateinit var monarchy: Monarchy
|
||||||
|
|
||||||
override suspend fun doWork(): Result {
|
override suspend fun doWork(): Result {
|
||||||
|
|
||||||
val params = WorkerParamsFactory.fromData<Params>(inputData)
|
val params = WorkerParamsFactory.fromData<Params>(inputData)
|
||||||
?: return Result.failure()
|
?: return Result.failure()
|
||||||
|
|
||||||
|
@ -54,7 +54,6 @@ internal class DefaultPusherService @Inject constructor(private val context: Con
|
|||||||
lang: String, appDisplayName: String, deviceDisplayName: String,
|
lang: String, appDisplayName: String, deviceDisplayName: String,
|
||||||
url: String, append: Boolean, withEventIdOnly: Boolean)
|
url: String, append: Boolean, withEventIdOnly: Boolean)
|
||||||
: UUID {
|
: UUID {
|
||||||
|
|
||||||
val pusher = JsonPusher(
|
val pusher = JsonPusher(
|
||||||
pushKey = pushkey,
|
pushKey = pushkey,
|
||||||
kind = "http",
|
kind = "http",
|
||||||
|
@ -278,7 +278,6 @@ internal class DefaultEventRelationsAggregationTask @Inject constructor(
|
|||||||
} else {
|
} else {
|
||||||
// is this a known event (is possible? pagination?)
|
// is this a known event (is possible? pagination?)
|
||||||
if (!sum.sourceEvents.contains(reactionEventId)) {
|
if (!sum.sourceEvents.contains(reactionEventId)) {
|
||||||
|
|
||||||
// check if it's not the sync of a local echo
|
// check if it's not the sync of a local echo
|
||||||
if (!isLocalEcho && sum.sourceLocalEcho.contains(txId)) {
|
if (!isLocalEcho && sum.sourceLocalEcho.contains(txId)) {
|
||||||
// ok it has already been counted, just sync the list, do not touch count
|
// ok it has already been counted, just sync the list, do not touch count
|
||||||
|
@ -101,7 +101,6 @@ internal class DefaultReadService @AssistedInject constructor(@Assisted private
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun getEventReadReceiptsLive(eventId: String): LiveData<List<ReadReceipt>> {
|
override fun getEventReadReceiptsLive(eventId: String): LiveData<List<ReadReceipt>> {
|
||||||
|
|
||||||
val liveRealmData = monarchy.findAllMappedWithChanges(
|
val liveRealmData = monarchy.findAllMappedWithChanges(
|
||||||
{ ReadReceiptsSummaryEntity.where(it, eventId) },
|
{ ReadReceiptsSummaryEntity.where(it, eventId) },
|
||||||
{ readReceiptsSummaryMapper.map(it) }
|
{ readReceiptsSummaryMapper.map(it) }
|
||||||
|
@ -76,7 +76,6 @@ internal class DefaultRelationService @AssistedInject constructor(@Assisted priv
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun undoReaction(reaction: String, targetEventId: String, myUserId: String)/*: Cancelable*/ {
|
override fun undoReaction(reaction: String, targetEventId: String, myUserId: String)/*: Cancelable*/ {
|
||||||
|
|
||||||
val params = FindReactionEventForUndoTask.Params(
|
val params = FindReactionEventForUndoTask.Params(
|
||||||
roomId,
|
roomId,
|
||||||
targetEventId,
|
targetEventId,
|
||||||
|
@ -107,7 +107,6 @@ internal class TokenChunkEventPersistor @Inject constructor(private val monarchy
|
|||||||
suspend fun insertInDb(receivedChunk: TokenChunkEvent,
|
suspend fun insertInDb(receivedChunk: TokenChunkEvent,
|
||||||
roomId: String,
|
roomId: String,
|
||||||
direction: PaginationDirection): Result {
|
direction: PaginationDirection): Result {
|
||||||
|
|
||||||
monarchy
|
monarchy
|
||||||
.awaitTransaction { realm ->
|
.awaitTransaction { realm ->
|
||||||
Timber.v("Start persisting ${receivedChunk.events.size} events in $roomId towards $direction")
|
Timber.v("Start persisting ${receivedChunk.events.size} events in $roomId towards $direction")
|
||||||
@ -194,7 +193,6 @@ internal class TokenChunkEventPersistor @Inject constructor(private val monarchy
|
|||||||
direction: PaginationDirection,
|
direction: PaginationDirection,
|
||||||
currentChunk: ChunkEntity,
|
currentChunk: ChunkEntity,
|
||||||
otherChunk: ChunkEntity): ChunkEntity {
|
otherChunk: ChunkEntity): ChunkEntity {
|
||||||
|
|
||||||
// We always merge the bottom chunk into top chunk, so we are always merging backwards
|
// We always merge the bottom chunk into top chunk, so we are always merging backwards
|
||||||
Timber.v("Merge ${currentChunk.prevToken} | ${currentChunk.nextToken} with ${otherChunk.prevToken} | ${otherChunk.nextToken}")
|
Timber.v("Merge ${currentChunk.prevToken} | ${currentChunk.nextToken} with ${otherChunk.prevToken} | ${otherChunk.nextToken}")
|
||||||
return if (direction == PaginationDirection.BACKWARDS && !otherChunk.isLastForward) {
|
return if (direction == PaginationDirection.BACKWARDS && !otherChunk.isLastForward) {
|
||||||
|
@ -261,7 +261,6 @@ internal class SecretStoringUtils @Inject constructor(private val context: Conte
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun decryptForOldDevicesNotGood(data: ByteArray, keyAlias: String): String? {
|
private fun decryptForOldDevicesNotGood(data: ByteArray, keyAlias: String): String? {
|
||||||
|
|
||||||
val (salt, iv, encrypted) = format2Extract(ByteArrayInputStream(data))
|
val (salt, iv, encrypted) = format2Extract(ByteArrayInputStream(data))
|
||||||
val factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256")
|
val factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256")
|
||||||
val spec = PBEKeySpec(keyAlias.toCharArray(), salt, 10_000, 128)
|
val spec = PBEKeySpec(keyAlias.toCharArray(), salt, 10_000, 128)
|
||||||
@ -280,7 +279,6 @@ internal class SecretStoringUtils @Inject constructor(private val context: Conte
|
|||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.KITKAT)
|
@RequiresApi(Build.VERSION_CODES.KITKAT)
|
||||||
private fun decryptStringK(data: ByteArray, keyAlias: String): String? {
|
private fun decryptStringK(data: ByteArray, keyAlias: String): String? {
|
||||||
|
|
||||||
val (encryptedKey, iv, encrypted) = format1Extract(ByteArrayInputStream(data))
|
val (encryptedKey, iv, encrypted) = format1Extract(ByteArrayInputStream(data))
|
||||||
|
|
||||||
// we need to decrypt the key
|
// we need to decrypt the key
|
||||||
@ -411,7 +409,6 @@ internal class SecretStoringUtils @Inject constructor(private val context: Conte
|
|||||||
@RequiresApi(Build.VERSION_CODES.KITKAT)
|
@RequiresApi(Build.VERSION_CODES.KITKAT)
|
||||||
@Throws(IOException::class)
|
@Throws(IOException::class)
|
||||||
private fun <T> loadSecureObjectK(keyAlias: String, inputStream: InputStream): T? {
|
private fun <T> loadSecureObjectK(keyAlias: String, inputStream: InputStream): T? {
|
||||||
|
|
||||||
val (encryptedKey, iv, encrypted) = format1Extract(inputStream)
|
val (encryptedKey, iv, encrypted) = format1Extract(inputStream)
|
||||||
|
|
||||||
// we need to decrypt the key
|
// we need to decrypt the key
|
||||||
|
@ -92,7 +92,6 @@ internal class RoomSyncHandler @Inject constructor(private val monarchy: Monarch
|
|||||||
// PRIVATE METHODS *****************************************************************************
|
// PRIVATE METHODS *****************************************************************************
|
||||||
|
|
||||||
private fun handleRoomSync(realm: Realm, handlingStrategy: HandlingStrategy, isInitialSync: Boolean, reporter: DefaultInitialSyncProgressService?) {
|
private fun handleRoomSync(realm: Realm, handlingStrategy: HandlingStrategy, isInitialSync: Boolean, reporter: DefaultInitialSyncProgressService?) {
|
||||||
|
|
||||||
val rooms = when (handlingStrategy) {
|
val rooms = when (handlingStrategy) {
|
||||||
is HandlingStrategy.JOINED ->
|
is HandlingStrategy.JOINED ->
|
||||||
handlingStrategy.data.mapWithProgress(reporter, R.string.initial_sync_start_importing_account_joined_rooms, 0.6f) {
|
handlingStrategy.data.mapWithProgress(reporter, R.string.initial_sync_start_importing_account_joined_rooms, 0.6f) {
|
||||||
@ -116,7 +115,6 @@ internal class RoomSyncHandler @Inject constructor(private val monarchy: Monarch
|
|||||||
roomId: String,
|
roomId: String,
|
||||||
roomSync: RoomSync,
|
roomSync: RoomSync,
|
||||||
isInitialSync: Boolean): RoomEntity {
|
isInitialSync: Boolean): RoomEntity {
|
||||||
|
|
||||||
Timber.v("Handle join sync for room $roomId")
|
Timber.v("Handle join sync for room $roomId")
|
||||||
|
|
||||||
if (roomSync.ephemeral != null && roomSync.ephemeral.events.isNotEmpty()) {
|
if (roomSync.ephemeral != null && roomSync.ephemeral.events.isNotEmpty()) {
|
||||||
@ -194,7 +192,6 @@ internal class RoomSyncHandler @Inject constructor(private val monarchy: Monarch
|
|||||||
eventList: List<Event>,
|
eventList: List<Event>,
|
||||||
prevToken: String? = null,
|
prevToken: String? = null,
|
||||||
isLimited: Boolean = true): ChunkEntity {
|
isLimited: Boolean = true): ChunkEntity {
|
||||||
|
|
||||||
val lastChunk = ChunkEntity.findLastLiveChunkFromRoom(realm, roomEntity.roomId)
|
val lastChunk = ChunkEntity.findLastLiveChunkFromRoom(realm, roomEntity.roomId)
|
||||||
var stateIndexOffset = 0
|
var stateIndexOffset = 0
|
||||||
val chunkEntity = if (!isLimited && lastChunk != null) {
|
val chunkEntity = if (!isLimited && lastChunk != null) {
|
||||||
|
@ -129,7 +129,6 @@ internal class SyncThread @Inject constructor(private val syncTask: SyncTask,
|
|||||||
this.callbackThread = TaskThread.SYNC
|
this.callbackThread = TaskThread.SYNC
|
||||||
this.executionThread = TaskThread.SYNC
|
this.executionThread = TaskThread.SYNC
|
||||||
this.callback = object : MatrixCallback<Unit> {
|
this.callback = object : MatrixCallback<Unit> {
|
||||||
|
|
||||||
override fun onSuccess(data: Unit) {
|
override fun onSuccess(data: Unit) {
|
||||||
Timber.v("onSuccess")
|
Timber.v("onSuccess")
|
||||||
latch.countDown()
|
latch.countDown()
|
||||||
|
@ -34,7 +34,6 @@ internal class TaskExecutor @Inject constructor(private val coroutineDispatchers
|
|||||||
private val executorScope = CoroutineScope(SupervisorJob())
|
private val executorScope = CoroutineScope(SupervisorJob())
|
||||||
|
|
||||||
fun <PARAMS, RESULT> execute(task: ConfigurableTask<PARAMS, RESULT>): Cancelable {
|
fun <PARAMS, RESULT> execute(task: ConfigurableTask<PARAMS, RESULT>): Cancelable {
|
||||||
|
|
||||||
val job = executorScope.launch(task.callbackThread.toDispatcher()) {
|
val job = executorScope.launch(task.callbackThread.toDispatcher()) {
|
||||||
val resultOrFailure = runCatching {
|
val resultOrFailure = runCatching {
|
||||||
withContext(task.executionThread.toDispatcher()) {
|
withContext(task.executionThread.toDispatcher()) {
|
||||||
@ -66,7 +65,6 @@ internal class TaskExecutor @Inject constructor(private val coroutineDispatchers
|
|||||||
maxDelay: Long = 10_000, // 10 second
|
maxDelay: Long = 10_000, // 10 second
|
||||||
factor: Double = 2.0,
|
factor: Double = 2.0,
|
||||||
block: suspend () -> T): T {
|
block: suspend () -> T): T {
|
||||||
|
|
||||||
var currentDelay = initialDelay
|
var currentDelay = initialDelay
|
||||||
repeat(times - 1) {
|
repeat(times - 1) {
|
||||||
try {
|
try {
|
||||||
|
@ -240,7 +240,6 @@ object CompatUtil {
|
|||||||
KeyStoreException::class,
|
KeyStoreException::class,
|
||||||
IllegalBlockSizeException::class)
|
IllegalBlockSizeException::class)
|
||||||
fun createCipherOutputStream(out: OutputStream, context: Context): OutputStream? {
|
fun createCipherOutputStream(out: OutputStream, context: Context): OutputStream? {
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,6 @@ object LiveDataUtils {
|
|||||||
fun <FIRST, SECOND, OUT> combine(firstSource: LiveData<FIRST>,
|
fun <FIRST, SECOND, OUT> combine(firstSource: LiveData<FIRST>,
|
||||||
secondSource: LiveData<SECOND>,
|
secondSource: LiveData<SECOND>,
|
||||||
mapper: (FIRST, SECOND) -> OUT): LiveData<OUT> {
|
mapper: (FIRST, SECOND) -> OUT): LiveData<OUT> {
|
||||||
|
|
||||||
return MediatorLiveData<OUT>().apply {
|
return MediatorLiveData<OUT>().apply {
|
||||||
var firstValue: FIRST? = null
|
var firstValue: FIRST? = null
|
||||||
var secondValue: SECOND? = null
|
var secondValue: SECOND? = null
|
||||||
|
@ -128,7 +128,6 @@ class PushrulesConditionTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun test_roommember_condition() {
|
fun test_roommember_condition() {
|
||||||
|
|
||||||
val conditionEqual3 = RoomMemberCountCondition("3")
|
val conditionEqual3 = RoomMemberCountCondition("3")
|
||||||
val conditionEqual3Bis = RoomMemberCountCondition("==3")
|
val conditionEqual3Bis = RoomMemberCountCondition("==3")
|
||||||
val conditionLessThan3 = RoomMemberCountCondition("<3")
|
val conditionLessThan3 = RoomMemberCountCondition("<3")
|
||||||
|
@ -26,7 +26,6 @@ import im.vector.riotx.features.settings.troubleshoot.TroubleshootTest
|
|||||||
class TestBatteryOptimization(val fragment: Fragment) : TroubleshootTest(R.string.settings_troubleshoot_test_battery_title) {
|
class TestBatteryOptimization(val fragment: Fragment) : TroubleshootTest(R.string.settings_troubleshoot_test_battery_title) {
|
||||||
|
|
||||||
override fun perform() {
|
override fun perform() {
|
||||||
|
|
||||||
if (fragment.context != null && isIgnoringBatteryOptimizations(fragment.context!!)) {
|
if (fragment.context != null && isIgnoringBatteryOptimizations(fragment.context!!)) {
|
||||||
description = fragment.getString(R.string.settings_troubleshoot_test_battery_success)
|
description = fragment.getString(R.string.settings_troubleshoot_test_battery_success)
|
||||||
status = TestStatus.SUCCESS
|
status = TestStatus.SUCCESS
|
||||||
|
@ -31,7 +31,6 @@ import timber.log.Timber
|
|||||||
class AlarmSyncBroadcastReceiver : BroadcastReceiver() {
|
class AlarmSyncBroadcastReceiver : BroadcastReceiver() {
|
||||||
|
|
||||||
override fun onReceive(context: Context, intent: Intent) {
|
override fun onReceive(context: Context, intent: Intent) {
|
||||||
|
|
||||||
// Aquire a lock to give enough time for the sync :/
|
// Aquire a lock to give enough time for the sync :/
|
||||||
(context.getSystemService(Context.POWER_SERVICE) as PowerManager).run {
|
(context.getSystemService(Context.POWER_SERVICE) as PowerManager).run {
|
||||||
newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "riotx:fdroidSynclock").apply {
|
newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "riotx:fdroidSynclock").apply {
|
||||||
|
@ -174,7 +174,6 @@ class VectorFirebaseMessagingService : FirebaseMessagingService() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun handleNotificationWithoutSyncingMode(data: Map<String, String>, session: Session?) {
|
private fun handleNotificationWithoutSyncingMode(data: Map<String, String>, session: Session?) {
|
||||||
|
|
||||||
if (session == null) {
|
if (session == null) {
|
||||||
Timber.e("## handleNotificationWithoutSyncingMode cannot find session")
|
Timber.e("## handleNotificationWithoutSyncingMode cannot find session")
|
||||||
return
|
return
|
||||||
|
@ -29,7 +29,6 @@ class EmojiCompatWrapper @Inject constructor(private val context: Context) {
|
|||||||
private var initialized = false
|
private var initialized = false
|
||||||
|
|
||||||
fun init(fontRequest: FontRequest) {
|
fun init(fontRequest: FontRequest) {
|
||||||
|
|
||||||
// Use emoji compat for the benefit of emoji spans
|
// Use emoji compat for the benefit of emoji spans
|
||||||
val config = FontRequestEmojiCompatConfig(context, fontRequest)
|
val config = FontRequestEmojiCompatConfig(context, fontRequest)
|
||||||
// we want to replace all emojis with selected font
|
// we want to replace all emojis with selected font
|
||||||
|
@ -119,7 +119,6 @@ class VectorApplication : Application(), HasVectorInjector, MatrixConfiguration.
|
|||||||
lastAuthenticatedSession.configureAndStart(pushRuleTriggerListener, sessionListener)
|
lastAuthenticatedSession.configureAndStart(pushRuleTriggerListener, sessionListener)
|
||||||
}
|
}
|
||||||
ProcessLifecycleOwner.get().lifecycle.addObserver(object : LifecycleObserver {
|
ProcessLifecycleOwner.get().lifecycle.addObserver(object : LifecycleObserver {
|
||||||
|
|
||||||
@OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
|
@OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
|
||||||
fun entersForeground() {
|
fun entersForeground() {
|
||||||
FcmHelper.onEnterForeground(appContext)
|
FcmHelper.onEnterForeground(appContext)
|
||||||
|
@ -28,7 +28,6 @@ import im.vector.riotx.core.platform.SimpleTextWatcher
|
|||||||
|
|
||||||
fun EditText.setupAsSearch(@DrawableRes searchIconRes: Int = R.drawable.ic_filter,
|
fun EditText.setupAsSearch(@DrawableRes searchIconRes: Int = R.drawable.ic_filter,
|
||||||
@DrawableRes clearIconRes: Int = R.drawable.ic_x_green) {
|
@DrawableRes clearIconRes: Int = R.drawable.ic_x_green) {
|
||||||
|
|
||||||
addTextChangedListener(object : SimpleTextWatcher() {
|
addTextChangedListener(object : SimpleTextWatcher() {
|
||||||
override fun afterTextChanged(s: Editable) {
|
override fun afterTextChanged(s: Editable) {
|
||||||
val clearIcon = if (s.isNotEmpty()) clearIconRes else 0
|
val clearIcon = if (s.isNotEmpty()) clearIconRes else 0
|
||||||
|
@ -42,7 +42,6 @@ abstract class GenericFooterItem : VectorEpoxyModel<GenericFooterItem.Holder>()
|
|||||||
var itemClickAction: GenericItem.Action? = null
|
var itemClickAction: GenericItem.Action? = null
|
||||||
|
|
||||||
override fun bind(holder: Holder) {
|
override fun bind(holder: Holder) {
|
||||||
|
|
||||||
holder.text.setTextOrHide(text)
|
holder.text.setTextOrHide(text)
|
||||||
when (style) {
|
when (style) {
|
||||||
GenericItem.STYLE.BIG_TEXT -> holder.text.textSize = 18f
|
GenericItem.STYLE.BIG_TEXT -> holder.text.textSize = 18f
|
||||||
|
@ -237,7 +237,6 @@ fun openMedia(activity: Activity, savedMediaPath: String, mimeType: String) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun shareMedia(context: Context, file: File, mediaMimeType: String?) {
|
fun shareMedia(context: Context, file: File, mediaMimeType: String?) {
|
||||||
|
|
||||||
var mediaUri: Uri? = null
|
var mediaUri: Uri? = null
|
||||||
try {
|
try {
|
||||||
mediaUri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID + ".fileProvider", file)
|
mediaUri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID + ".fileProvider", file)
|
||||||
|
@ -37,7 +37,6 @@ class KeysExporter(private val session: Session) {
|
|||||||
*/
|
*/
|
||||||
fun export(context: Context, password: String, callback: MatrixCallback<String>) {
|
fun export(context: Context, password: String, callback: MatrixCallback<String>) {
|
||||||
session.exportRoomKeys(password, object : MatrixCallback<ByteArray> {
|
session.exportRoomKeys(password, object : MatrixCallback<ByteArray> {
|
||||||
|
|
||||||
override fun onSuccess(data: ByteArray) {
|
override fun onSuccess(data: ByteArray) {
|
||||||
GlobalScope.launch(Dispatchers.Main) {
|
GlobalScope.launch(Dispatchers.Main) {
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
|
@ -102,7 +102,6 @@ class KeysBackupRestoreFromKeyViewModel @Inject constructor() : ViewModel() {
|
|||||||
private fun trustOnDecrypt(keysBackup: KeysBackupService, keysVersionResult: KeysVersionResult) {
|
private fun trustOnDecrypt(keysBackup: KeysBackupService, keysVersionResult: KeysVersionResult) {
|
||||||
keysBackup.trustKeysBackupVersion(keysVersionResult, true,
|
keysBackup.trustKeysBackupVersion(keysVersionResult, true,
|
||||||
object : MatrixCallback<Unit> {
|
object : MatrixCallback<Unit> {
|
||||||
|
|
||||||
override fun onSuccess(data: Unit) {
|
override fun onSuccess(data: Unit) {
|
||||||
Timber.v("##### trustKeysBackupVersion onSuccess")
|
Timber.v("##### trustKeysBackupVersion onSuccess")
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,6 @@ class KeysBackupRestoreFromPassphraseViewModel @Inject constructor() : ViewModel
|
|||||||
private fun trustOnDecrypt(keysBackup: KeysBackupService, keysVersionResult: KeysVersionResult) {
|
private fun trustOnDecrypt(keysBackup: KeysBackupService, keysVersionResult: KeysVersionResult) {
|
||||||
keysBackup.trustKeysBackupVersion(keysVersionResult, true,
|
keysBackup.trustKeysBackupVersion(keysVersionResult, true,
|
||||||
object : MatrixCallback<Unit> {
|
object : MatrixCallback<Unit> {
|
||||||
|
|
||||||
override fun onSuccess(data: Unit) {
|
override fun onSuccess(data: Unit) {
|
||||||
Timber.v("##### trustKeysBackupVersion onSuccess")
|
Timber.v("##### trustKeysBackupVersion onSuccess")
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,6 @@ class KeysBackupSetupActivity : SimpleFragmentActivity() {
|
|||||||
.export(this@KeysBackupSetupActivity,
|
.export(this@KeysBackupSetupActivity,
|
||||||
passphrase,
|
passphrase,
|
||||||
object : MatrixCallback<String> {
|
object : MatrixCallback<String> {
|
||||||
|
|
||||||
override fun onSuccess(data: String) {
|
override fun onSuccess(data: String) {
|
||||||
hideWaitingView()
|
hideWaitingView()
|
||||||
|
|
||||||
|
@ -303,7 +303,6 @@ class RoomDetailFragment :
|
|||||||
|
|
||||||
private fun setupNotificationView() {
|
private fun setupNotificationView() {
|
||||||
notificationAreaView.delegate = object : NotificationAreaView.Delegate {
|
notificationAreaView.delegate = object : NotificationAreaView.Delegate {
|
||||||
|
|
||||||
override fun onTombstoneEventClicked(tombstoneEvent: Event) {
|
override fun onTombstoneEventClicked(tombstoneEvent: Event) {
|
||||||
roomDetailViewModel.process(RoomDetailActions.HandleTombstoneEvent(tombstoneEvent))
|
roomDetailViewModel.process(RoomDetailActions.HandleTombstoneEvent(tombstoneEvent))
|
||||||
}
|
}
|
||||||
@ -453,7 +452,6 @@ class RoomDetailFragment :
|
|||||||
}
|
}
|
||||||
recyclerView.setController(timelineEventController)
|
recyclerView.setController(timelineEventController)
|
||||||
recyclerView.addOnScrollListener(object : RecyclerView.OnScrollListener() {
|
recyclerView.addOnScrollListener(object : RecyclerView.OnScrollListener() {
|
||||||
|
|
||||||
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
||||||
if (recyclerView.scrollState == RecyclerView.SCROLL_STATE_IDLE) {
|
if (recyclerView.scrollState == RecyclerView.SCROLL_STATE_IDLE) {
|
||||||
updateJumpToBottomViewVisibility()
|
updateJumpToBottomViewVisibility()
|
||||||
@ -702,7 +700,6 @@ class RoomDetailFragment :
|
|||||||
|
|
||||||
private fun renderRoomSummary(state: RoomDetailViewState) {
|
private fun renderRoomSummary(state: RoomDetailViewState) {
|
||||||
state.asyncRoomSummary()?.let {
|
state.asyncRoomSummary()?.let {
|
||||||
|
|
||||||
if (it.membership.isLeft()) {
|
if (it.membership.isLeft()) {
|
||||||
Timber.w("The room has been left")
|
Timber.w("The room has been left")
|
||||||
activity?.finish()
|
activity?.finish()
|
||||||
|
@ -74,7 +74,6 @@ class TextComposerView @JvmOverloads constructor(context: Context, attrs: Attrib
|
|||||||
val transition = AutoTransition()
|
val transition = AutoTransition()
|
||||||
transition.duration = animationDuration
|
transition.duration = animationDuration
|
||||||
transition.addListener(object : Transition.TransitionListener {
|
transition.addListener(object : Transition.TransitionListener {
|
||||||
|
|
||||||
override fun onTransitionEnd(transition: Transition) {
|
override fun onTransitionEnd(transition: Transition) {
|
||||||
transitionComplete?.invoke()
|
transitionComplete?.invoke()
|
||||||
}
|
}
|
||||||
@ -106,7 +105,6 @@ class TextComposerView @JvmOverloads constructor(context: Context, attrs: Attrib
|
|||||||
val transition = AutoTransition()
|
val transition = AutoTransition()
|
||||||
transition.duration = animationDuration
|
transition.duration = animationDuration
|
||||||
transition.addListener(object : Transition.TransitionListener {
|
transition.addListener(object : Transition.TransitionListener {
|
||||||
|
|
||||||
override fun onTransitionEnd(transition: Transition) {
|
override fun onTransitionEnd(transition: Transition) {
|
||||||
transitionComplete?.invoke()
|
transitionComplete?.invoke()
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,6 @@ class MessageActionsBottomSheet : VectorBaseBottomSheetDialogFragment() {
|
|||||||
.commit()
|
.commit()
|
||||||
}
|
}
|
||||||
quickReactionFragment.interactionListener = object : QuickReactionFragment.InteractionListener {
|
quickReactionFragment.interactionListener = object : QuickReactionFragment.InteractionListener {
|
||||||
|
|
||||||
override fun didQuickReactWith(clickedOn: String, add: Boolean, eventId: String) {
|
override fun didQuickReactWith(clickedOn: String, add: Boolean, eventId: String) {
|
||||||
actionHandlerModel.fireAction(SimpleAction.QuickReact(eventId, clickedOn, add))
|
actionHandlerModel.fireAction(SimpleAction.QuickReact(eventId, clickedOn, add))
|
||||||
dismiss()
|
dismiss()
|
||||||
|
@ -172,7 +172,6 @@ class MessageMenuViewModel @AssistedInject constructor(@Assisted initialState: M
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (event.root.sendState == SendState.SENT) {
|
if (event.root.sendState == SendState.SENT) {
|
||||||
|
|
||||||
// TODO Can be redacted
|
// TODO Can be redacted
|
||||||
|
|
||||||
// TODO sent by me or sufficient power level
|
// TODO sent by me or sufficient power level
|
||||||
|
@ -34,7 +34,6 @@ class DefaultItemFactory @Inject constructor(private val avatarSizeProvider: Ava
|
|||||||
informationData: MessageInformationData,
|
informationData: MessageInformationData,
|
||||||
highlight: Boolean,
|
highlight: Boolean,
|
||||||
callback: TimelineEventController.Callback?): DefaultItem {
|
callback: TimelineEventController.Callback?): DefaultItem {
|
||||||
|
|
||||||
return DefaultItem_()
|
return DefaultItem_()
|
||||||
.leftGuideline(avatarSizeProvider.leftGuideline)
|
.leftGuideline(avatarSizeProvider.leftGuideline)
|
||||||
.highlighted(highlight)
|
.highlighted(highlight)
|
||||||
|
@ -41,7 +41,6 @@ class EncryptionItemFactory @Inject constructor(private val stringProvider: Stri
|
|||||||
fun create(event: TimelineEvent,
|
fun create(event: TimelineEvent,
|
||||||
highlight: Boolean,
|
highlight: Boolean,
|
||||||
callback: TimelineEventController.Callback?): NoticeItem? {
|
callback: TimelineEventController.Callback?): NoticeItem? {
|
||||||
|
|
||||||
val text = buildNoticeText(event.root, event.senderName) ?: return null
|
val text = buildNoticeText(event.root, event.senderName) ?: return null
|
||||||
val informationData = MessageInformationData(
|
val informationData = MessageInformationData(
|
||||||
eventId = event.root.eventId ?: "?",
|
eventId = event.root.eventId ?: "?",
|
||||||
|
@ -42,7 +42,6 @@ class MergedHeaderItemFactory @Inject constructor(private val sessionHolder: Act
|
|||||||
callback: TimelineEventController.Callback?,
|
callback: TimelineEventController.Callback?,
|
||||||
requestModelBuild: () -> Unit)
|
requestModelBuild: () -> Unit)
|
||||||
: MergedHeaderItem? {
|
: MergedHeaderItem? {
|
||||||
|
|
||||||
return if (!event.canBeMerged() || (nextEvent?.root?.getClearType() == event.root.getClearType() && !addDaySeparator)) {
|
return if (!event.canBeMerged() || (nextEvent?.root?.getClearType() == event.root.getClearType() && !addDaySeparator)) {
|
||||||
null
|
null
|
||||||
} else {
|
} else {
|
||||||
|
@ -166,7 +166,6 @@ class MessageItemFactory @Inject constructor(
|
|||||||
highlight: Boolean,
|
highlight: Boolean,
|
||||||
callback: TimelineEventController.Callback?,
|
callback: TimelineEventController.Callback?,
|
||||||
attributes: AbsMessageItem.Attributes): MessageImageVideoItem? {
|
attributes: AbsMessageItem.Attributes): MessageImageVideoItem? {
|
||||||
|
|
||||||
val (maxWidth, maxHeight) = timelineMediaSizeProvider.getMaxSize()
|
val (maxWidth, maxHeight) = timelineMediaSizeProvider.getMaxSize()
|
||||||
val data = ImageContentRenderer.Data(
|
val data = ImageContentRenderer.Data(
|
||||||
filename = messageContent.body,
|
filename = messageContent.body,
|
||||||
@ -196,7 +195,6 @@ class MessageItemFactory @Inject constructor(
|
|||||||
highlight: Boolean,
|
highlight: Boolean,
|
||||||
callback: TimelineEventController.Callback?,
|
callback: TimelineEventController.Callback?,
|
||||||
attributes: AbsMessageItem.Attributes): MessageImageVideoItem? {
|
attributes: AbsMessageItem.Attributes): MessageImageVideoItem? {
|
||||||
|
|
||||||
val (maxWidth, maxHeight) = timelineMediaSizeProvider.getMaxSize()
|
val (maxWidth, maxHeight) = timelineMediaSizeProvider.getMaxSize()
|
||||||
val thumbnailData = ImageContentRenderer.Data(
|
val thumbnailData = ImageContentRenderer.Data(
|
||||||
filename = messageContent.body,
|
filename = messageContent.body,
|
||||||
@ -233,7 +231,6 @@ class MessageItemFactory @Inject constructor(
|
|||||||
highlight: Boolean,
|
highlight: Boolean,
|
||||||
callback: TimelineEventController.Callback?,
|
callback: TimelineEventController.Callback?,
|
||||||
attributes: AbsMessageItem.Attributes): MessageTextItem? {
|
attributes: AbsMessageItem.Attributes): MessageTextItem? {
|
||||||
|
|
||||||
val isFormatted = messageContent.formattedBody.isNullOrBlank().not()
|
val isFormatted = messageContent.formattedBody.isNullOrBlank().not()
|
||||||
val bodyToUse = messageContent.formattedBody?.let {
|
val bodyToUse = messageContent.formattedBody?.let {
|
||||||
htmlRenderer.get().render(it.trim())
|
htmlRenderer.get().render(it.trim())
|
||||||
@ -296,7 +293,6 @@ class MessageItemFactory @Inject constructor(
|
|||||||
highlight: Boolean,
|
highlight: Boolean,
|
||||||
callback: TimelineEventController.Callback?,
|
callback: TimelineEventController.Callback?,
|
||||||
attributes: AbsMessageItem.Attributes): MessageTextItem? {
|
attributes: AbsMessageItem.Attributes): MessageTextItem? {
|
||||||
|
|
||||||
val message = messageContent.body.let {
|
val message = messageContent.body.let {
|
||||||
val formattedBody = span {
|
val formattedBody = span {
|
||||||
text = it
|
text = it
|
||||||
@ -318,7 +314,6 @@ class MessageItemFactory @Inject constructor(
|
|||||||
highlight: Boolean,
|
highlight: Boolean,
|
||||||
callback: TimelineEventController.Callback?,
|
callback: TimelineEventController.Callback?,
|
||||||
attributes: AbsMessageItem.Attributes): MessageTextItem? {
|
attributes: AbsMessageItem.Attributes): MessageTextItem? {
|
||||||
|
|
||||||
val message = messageContent.body.let {
|
val message = messageContent.body.let {
|
||||||
val formattedBody = "* ${informationData.memberName} $it"
|
val formattedBody = "* ${informationData.memberName} $it"
|
||||||
linkifyBody(formattedBody, callback)
|
linkifyBody(formattedBody, callback)
|
||||||
|
@ -36,7 +36,6 @@ class NoticeItemFactory @Inject constructor(private val eventFormatter: NoticeEv
|
|||||||
highlight: Boolean,
|
highlight: Boolean,
|
||||||
readMarkerVisible: Boolean,
|
readMarkerVisible: Boolean,
|
||||||
callback: TimelineEventController.Callback?): NoticeItem? {
|
callback: TimelineEventController.Callback?): NoticeItem? {
|
||||||
|
|
||||||
val formattedText = eventFormatter.format(event) ?: return null
|
val formattedText = eventFormatter.format(event) ?: return null
|
||||||
val informationData = informationDataFactory.create(event, null, readMarkerVisible)
|
val informationData = informationDataFactory.create(event, null, readMarkerVisible)
|
||||||
val attributes = NoticeItem.Attributes(
|
val attributes = NoticeItem.Attributes(
|
||||||
|
@ -35,7 +35,6 @@ class TimelineItemFactory @Inject constructor(private val messageItemFactory: Me
|
|||||||
eventIdToHighlight: String?,
|
eventIdToHighlight: String?,
|
||||||
readMarkerVisible: Boolean,
|
readMarkerVisible: Boolean,
|
||||||
callback: TimelineEventController.Callback?): VectorEpoxyModel<*> {
|
callback: TimelineEventController.Callback?): VectorEpoxyModel<*> {
|
||||||
|
|
||||||
val highlight = event.root.eventId == eventIdToHighlight
|
val highlight = event.root.eventId == eventIdToHighlight
|
||||||
|
|
||||||
val computedModel = try {
|
val computedModel = try {
|
||||||
|
@ -40,7 +40,6 @@ class ContentUploadStateTrackerBinder @Inject constructor(private val activeSess
|
|||||||
fun bind(eventId: String,
|
fun bind(eventId: String,
|
||||||
isLocalFile: Boolean,
|
isLocalFile: Boolean,
|
||||||
progressLayout: ViewGroup) {
|
progressLayout: ViewGroup) {
|
||||||
|
|
||||||
activeSessionHolder.getActiveSession().also { session ->
|
activeSessionHolder.getActiveSession().also { session ->
|
||||||
val uploadStateTracker = session.contentUploadProgressTracker()
|
val uploadStateTracker = session.contentUploadProgressTracker()
|
||||||
val updateListener = ContentMediaProgressUpdater(progressLayout, isLocalFile, colorProvider, errorFormatter)
|
val updateListener = ContentMediaProgressUpdater(progressLayout, isLocalFile, colorProvider, errorFormatter)
|
||||||
|
@ -37,7 +37,6 @@ class MessageItemAttributesFactory @Inject constructor(
|
|||||||
fun create(messageContent: MessageContent?,
|
fun create(messageContent: MessageContent?,
|
||||||
informationData: MessageInformationData,
|
informationData: MessageInformationData,
|
||||||
callback: TimelineEventController.Callback?): AbsMessageItem.Attributes {
|
callback: TimelineEventController.Callback?): AbsMessageItem.Attributes {
|
||||||
|
|
||||||
return AbsMessageItem.Attributes(
|
return AbsMessageItem.Attributes(
|
||||||
avatarSize = avatarSizeProvider.avatarSize,
|
avatarSize = avatarSizeProvider.avatarSize,
|
||||||
informationData = informationData,
|
informationData = informationData,
|
||||||
|
@ -271,7 +271,6 @@ class LoginSsoFallbackFragment : VectorBaseFragment(), OnBackPressed {
|
|||||||
if (parameters.containsKey("homeServer")
|
if (parameters.containsKey("homeServer")
|
||||||
&& parameters.containsKey("userId")
|
&& parameters.containsKey("userId")
|
||||||
&& parameters.containsKey("accessToken")) {
|
&& parameters.containsKey("accessToken")) {
|
||||||
|
|
||||||
// We cannot parse Credentials here because of https://github.com/matrix-org/synapse/issues/4756
|
// We cannot parse Credentials here because of https://github.com/matrix-org/synapse/issues/4756
|
||||||
// Build on object manually
|
// Build on object manually
|
||||||
val credentials = Credentials(
|
val credentials = Credentials(
|
||||||
|
@ -89,7 +89,6 @@ class VideoContentRenderer @Inject constructor(private val activeSessionHolder:
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
val resolvedUrl = contentUrlResolver.resolveFullSize(data.url)
|
val resolvedUrl = contentUrlResolver.resolveFullSize(data.url)
|
||||||
|
|
||||||
if (resolvedUrl == null) {
|
if (resolvedUrl == null) {
|
||||||
@ -98,7 +97,6 @@ class VideoContentRenderer @Inject constructor(private val activeSessionHolder:
|
|||||||
errorView.isVisible = true
|
errorView.isVisible = true
|
||||||
errorView.setText(R.string.unknown_error)
|
errorView.setText(R.string.unknown_error)
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Temporary code, some remote videos are not played by videoview setVideoUri
|
// Temporary code, some remote videos are not played by videoview setVideoUri
|
||||||
// So for now we download them then play
|
// So for now we download them then play
|
||||||
thumbnailView.isVisible = true
|
thumbnailView.isVisible = true
|
||||||
|
@ -64,7 +64,6 @@ class NotifiableEventResolver @Inject constructor(private val stringProvider: St
|
|||||||
return resolveStateRoomEvent(event, session)
|
return resolveStateRoomEvent(event, session)
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
|
|
||||||
// If the event can be displayed, display it as is
|
// If the event can be displayed, display it as is
|
||||||
Timber.w("NotifiableEventResolver Received an unsupported event matching a bing rule")
|
Timber.w("NotifiableEventResolver Received an unsupported event matching a bing rule")
|
||||||
// TODO Better event text display
|
// TODO Better event text display
|
||||||
@ -85,7 +84,6 @@ class NotifiableEventResolver @Inject constructor(private val stringProvider: St
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun resolveMessageEvent(event: TimelineEvent, session: Session): NotifiableEvent? {
|
private fun resolveMessageEvent(event: TimelineEvent, session: Session): NotifiableEvent? {
|
||||||
|
|
||||||
// The event only contains an eventId, and roomId (type is m.room.*) , we need to get the displayable content (names, avatar, text, etc...)
|
// The event only contains an eventId, and roomId (type is m.room.*) , we need to get the displayable content (names, avatar, text, etc...)
|
||||||
val room = session.getRoom(event.root.roomId!! /*roomID cannot be null*/)
|
val room = session.getRoom(event.root.roomId!! /*roomID cannot be null*/)
|
||||||
|
|
||||||
|
@ -109,7 +109,6 @@ class NotificationBroadcastReceiver : BroadcastReceiver() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun sendMatrixEvent(message: String, session: Session, room: Room, context: Context?) {
|
private fun sendMatrixEvent(message: String, session: Session, room: Room, context: Context?) {
|
||||||
|
|
||||||
room.sendTextMessage(message)
|
room.sendTextMessage(message)
|
||||||
|
|
||||||
// Create a new event to be displayed in the notification drawer, right now
|
// Create a new event to be displayed in the notification drawer, right now
|
||||||
|
@ -207,7 +207,6 @@ class NotificationDrawerManager @Inject constructor(private val context: Context
|
|||||||
val myUserDisplayName = user?.displayName?.takeIf { it.isNotBlank() } ?: session.myUserId
|
val myUserDisplayName = user?.displayName?.takeIf { it.isNotBlank() } ?: session.myUserId
|
||||||
val myUserAvatarUrl = session.contentUrlResolver().resolveThumbnail(user?.avatarUrl, avatarSize, avatarSize, ContentUrlResolver.ThumbnailMethod.SCALE)
|
val myUserAvatarUrl = session.contentUrlResolver().resolveThumbnail(user?.avatarUrl, avatarSize, avatarSize, ContentUrlResolver.ThumbnailMethod.SCALE)
|
||||||
synchronized(eventList) {
|
synchronized(eventList) {
|
||||||
|
|
||||||
Timber.v("%%%%%%%% REFRESH NOTIFICATION DRAWER ")
|
Timber.v("%%%%%%%% REFRESH NOTIFICATION DRAWER ")
|
||||||
// TMP code
|
// TMP code
|
||||||
var hasNewEvent = false
|
var hasNewEvent = false
|
||||||
|
@ -322,7 +322,6 @@ class NotificationUtils @Inject constructor(private val context: Context,
|
|||||||
roomId: String,
|
roomId: String,
|
||||||
matrixId: String,
|
matrixId: String,
|
||||||
callId: String): Notification {
|
callId: String): Notification {
|
||||||
|
|
||||||
val builder = NotificationCompat.Builder(context, CALL_NOTIFICATION_CHANNEL_ID)
|
val builder = NotificationCompat.Builder(context, CALL_NOTIFICATION_CHANNEL_ID)
|
||||||
.setContentTitle(ensureTitleNotEmpty(roomName))
|
.setContentTitle(ensureTitleNotEmpty(roomName))
|
||||||
.apply {
|
.apply {
|
||||||
|
@ -166,7 +166,6 @@ object PopupAlertManager {
|
|||||||
.setTitle(alert.title)
|
.setTitle(alert.title)
|
||||||
.setText(alert.description)
|
.setText(alert.description)
|
||||||
.apply {
|
.apply {
|
||||||
|
|
||||||
if (!animate) {
|
if (!animate) {
|
||||||
setEnterAnimation(R.anim.anim_alerter_no_anim)
|
setEnterAnimation(R.anim.anim_alerter_no_anim)
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,6 @@ class BugReporter @Inject constructor(private val activeSessionHolder: ActiveSes
|
|||||||
theBugDescription: String,
|
theBugDescription: String,
|
||||||
listener: IMXBugReportListener?) {
|
listener: IMXBugReportListener?) {
|
||||||
object : AsyncTask<Void, Int, String>() {
|
object : AsyncTask<Void, Int, String>() {
|
||||||
|
|
||||||
// enumerate files to delete
|
// enumerate files to delete
|
||||||
val mBugReportFiles: MutableList<File> = ArrayList()
|
val mBugReportFiles: MutableList<File> = ArrayList()
|
||||||
|
|
||||||
|
@ -138,7 +138,6 @@ class EmojiReactionPickerActivity : VectorBaseActivity(), EmojiCompatFontProvide
|
|||||||
|
|
||||||
val searchItem = menu.findItem(R.id.search)
|
val searchItem = menu.findItem(R.id.search)
|
||||||
(searchItem.actionView as? SearchView)?.let {
|
(searchItem.actionView as? SearchView)?.let {
|
||||||
|
|
||||||
searchItem.setOnActionExpandListener(object : MenuItem.OnActionExpandListener {
|
searchItem.setOnActionExpandListener(object : MenuItem.OnActionExpandListener {
|
||||||
override fun onMenuItemActionExpand(p0: MenuItem?): Boolean {
|
override fun onMenuItemActionExpand(p0: MenuItem?): Boolean {
|
||||||
it.isIconified = false
|
it.isIconified = false
|
||||||
|
@ -160,7 +160,6 @@ class ReactionButton @JvmOverloads constructor(context: Context, attrs: Attribut
|
|||||||
* @param v
|
* @param v
|
||||||
*/
|
*/
|
||||||
override fun onClick(v: View) {
|
override fun onClick(v: View) {
|
||||||
|
|
||||||
if (!isEnabled) {
|
if (!isEnabled) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,6 @@ class VectorSettingsHelpAboutFragment : VectorSettingsBaseFragment() {
|
|||||||
// preference to start the App info screen, to facilitate App permissions access
|
// preference to start the App info screen, to facilitate App permissions access
|
||||||
findPreference<VectorPreference>(APP_INFO_LINK_PREFERENCE_KEY)!!
|
findPreference<VectorPreference>(APP_INFO_LINK_PREFERENCE_KEY)!!
|
||||||
.onPreferenceClickListener = Preference.OnPreferenceClickListener {
|
.onPreferenceClickListener = Preference.OnPreferenceClickListener {
|
||||||
|
|
||||||
activity?.let {
|
activity?.let {
|
||||||
val intent = Intent().apply {
|
val intent = Intent().apply {
|
||||||
action = Settings.ACTION_APPLICATION_DETAILS_SETTINGS
|
action = Settings.ACTION_APPLICATION_DETAILS_SETTINGS
|
||||||
|
@ -67,7 +67,6 @@ class VectorSettingsNotificationPreferenceFragment : VectorSettingsBaseFragment(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onPreferenceTreeClick(preference: Preference?): Boolean {
|
override fun onPreferenceTreeClick(preference: Preference?): Boolean {
|
||||||
|
|
||||||
return when (preference?.key) {
|
return when (preference?.key) {
|
||||||
VectorPreferences.SETTINGS_ENABLE_THIS_DEVICE_PREFERENCE_KEY -> {
|
VectorPreferences.SETTINGS_ENABLE_THIS_DEVICE_PREFERENCE_KEY -> {
|
||||||
updateEnabledForDevice(preference)
|
updateEnabledForDevice(preference)
|
||||||
@ -119,7 +118,6 @@ class VectorSettingsNotificationPreferenceFragment : VectorSettingsBaseFragment(
|
|||||||
it,
|
it,
|
||||||
!switchPref.isChecked,
|
!switchPref.isChecked,
|
||||||
object : MatrixCallback<Unit> {
|
object : MatrixCallback<Unit> {
|
||||||
|
|
||||||
override fun onSuccess(data: Unit) {
|
override fun onSuccess(data: Unit) {
|
||||||
// Push rules will be updated form the sync
|
// Push rules will be updated form the sync
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,6 @@ class VectorSettingsNotificationsTroubleshootFragment : VectorBaseFragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun startUI() {
|
private fun startUI() {
|
||||||
|
|
||||||
mSummaryDescription.text = getString(R.string.settings_troubleshoot_diagnostic_running_status,
|
mSummaryDescription.text = getString(R.string.settings_troubleshoot_diagnostic_running_status,
|
||||||
0, 0)
|
0, 0)
|
||||||
testManager = testManagerFactory.create(this)
|
testManager = testManagerFactory.create(this)
|
||||||
|
@ -560,9 +560,7 @@ class VectorSettingsSecurityPrivacyFragment : VectorSettingsBaseFragment() {
|
|||||||
* @param aDeviceInfo the device information
|
* @param aDeviceInfo the device information
|
||||||
*/
|
*/
|
||||||
private fun displayDeviceDetailsDialog(aDeviceInfo: DeviceInfo) {
|
private fun displayDeviceDetailsDialog(aDeviceInfo: DeviceInfo) {
|
||||||
|
|
||||||
activity?.let {
|
activity?.let {
|
||||||
|
|
||||||
val builder = AlertDialog.Builder(it)
|
val builder = AlertDialog.Builder(it)
|
||||||
val inflater = it.layoutInflater
|
val inflater = it.layoutInflater
|
||||||
val layout = inflater.inflate(R.layout.dialog_device_details, null)
|
val layout = inflater.inflate(R.layout.dialog_device_details, null)
|
||||||
|
@ -66,7 +66,6 @@ class NotificationTroubleshootRecyclerViewAdapter(val tests: ArrayList<Troublesh
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun bind(test: TroubleshootTest) {
|
fun bind(test: TroubleshootTest) {
|
||||||
|
|
||||||
val context = itemView.context
|
val context = itemView.context
|
||||||
titleText.setTextColor(ThemeUtils.getColor(context, R.attr.riotx_text_primary))
|
titleText.setTextColor(ThemeUtils.getColor(context, R.attr.riotx_text_primary))
|
||||||
descriptionText.setTextColor(ThemeUtils.getColor(context, R.attr.riotx_text_secondary))
|
descriptionText.setTextColor(ThemeUtils.getColor(context, R.attr.riotx_text_secondary))
|
||||||
|
@ -48,7 +48,6 @@ class TestAccountSettings @Inject constructor(private val stringProvider: String
|
|||||||
|
|
||||||
session.updatePushRuleEnableStatus(RuleKind.OVERRIDE, defaultRule, !defaultRule.enabled,
|
session.updatePushRuleEnableStatus(RuleKind.OVERRIDE, defaultRule, !defaultRule.enabled,
|
||||||
object : MatrixCallback<Unit> {
|
object : MatrixCallback<Unit> {
|
||||||
|
|
||||||
override fun onSuccess(data: Unit) {
|
override fun onSuccess(data: Unit) {
|
||||||
manager?.retry()
|
manager?.retry()
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,6 @@ class TestDeviceSettings @Inject constructor(private val vectorPreferences: Vect
|
|||||||
: TroubleshootTest(R.string.settings_troubleshoot_test_device_settings_title) {
|
: TroubleshootTest(R.string.settings_troubleshoot_test_device_settings_title) {
|
||||||
|
|
||||||
override fun perform() {
|
override fun perform() {
|
||||||
|
|
||||||
if (vectorPreferences.areNotificationEnabledForDevice()) {
|
if (vectorPreferences.areNotificationEnabledForDevice()) {
|
||||||
description = stringProvider.getString(R.string.settings_troubleshoot_test_device_settings_success)
|
description = stringProvider.getString(R.string.settings_troubleshoot_test_device_settings_success)
|
||||||
quickFix = null
|
quickFix = null
|
||||||
|
Loading…
x
Reference in New Issue
Block a user