forked from GitHub-Mirror/riotX-android
Fix done TODO
This commit is contained in:
parent
a476ac71da
commit
f41c0311fa
@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '1.3.21'
|
ext.kotlin_version = '1.3.21'
|
||||||
ext.koin_version = '1.0.2'
|
|
||||||
// TODO ext.koin_version = '2.0.0-GA'
|
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
|
@ -148,13 +148,11 @@ dependencies {
|
|||||||
|
|
||||||
testImplementation 'junit:junit:4.12'
|
testImplementation 'junit:junit:4.12'
|
||||||
testImplementation 'org.robolectric:robolectric:4.0.2'
|
testImplementation 'org.robolectric:robolectric:4.0.2'
|
||||||
testImplementation "org.koin:koin-test:$koin_version"
|
|
||||||
//testImplementation 'org.robolectric:shadows-support-v4:3.0'
|
//testImplementation 'org.robolectric:shadows-support-v4:3.0'
|
||||||
testImplementation "io.mockk:mockk:1.8.13.kotlin13"
|
testImplementation "io.mockk:mockk:1.8.13.kotlin13"
|
||||||
testImplementation 'org.amshove.kluent:kluent-android:1.44'
|
testImplementation 'org.amshove.kluent:kluent-android:1.44'
|
||||||
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
|
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
|
||||||
|
|
||||||
androidTestImplementation "org.koin:koin-test:$koin_version"
|
|
||||||
androidTestImplementation 'androidx.test:core:1.2.0'
|
androidTestImplementation 'androidx.test:core:1.2.0'
|
||||||
androidTestImplementation 'androidx.test:runner:1.2.0'
|
androidTestImplementation 'androidx.test:runner:1.2.0'
|
||||||
androidTestImplementation 'androidx.test:rules:1.2.0'
|
androidTestImplementation 'androidx.test:rules:1.2.0'
|
||||||
|
@ -36,17 +36,15 @@ interface Authenticator {
|
|||||||
*/
|
*/
|
||||||
fun authenticate(homeServerConnectionConfig: HomeServerConnectionConfig, login: String, password: String, callback: MatrixCallback<Session>): Cancelable
|
fun authenticate(homeServerConnectionConfig: HomeServerConnectionConfig, login: String, password: String, callback: MatrixCallback<Session>): Cancelable
|
||||||
|
|
||||||
//TODO remove this method. Shouldn't be managed like that.
|
|
||||||
/**
|
/**
|
||||||
* Check if there is an active [Session].
|
* Check if there is an authenticated [Session].
|
||||||
* @return true if there is at least one active session.
|
* @return true if there is at least one active session.
|
||||||
*/
|
*/
|
||||||
fun hasAuthenticatedSessions(): Boolean
|
fun hasAuthenticatedSessions(): Boolean
|
||||||
|
|
||||||
//TODO remove this method. Shouldn't be managed like that.
|
|
||||||
/**
|
/**
|
||||||
* Get the last active [Session], if there is an active session.
|
* Get the last authenticated [Session], if there is an active session.
|
||||||
* @return the lastActive session if any, or null
|
* @return the last active session if any, or null
|
||||||
*/
|
*/
|
||||||
fun getLastAuthenticatedSession(): Session?
|
fun getLastAuthenticatedSession(): Session?
|
||||||
|
|
||||||
@ -58,7 +56,4 @@ interface Authenticator {
|
|||||||
* @return the associated session if any, or null
|
* @return the associated session if any, or null
|
||||||
*/
|
*/
|
||||||
fun getSession(sessionParams: SessionParams): Session?
|
fun getSession(sessionParams: SessionParams): Session?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -20,7 +20,6 @@ import im.vector.matrix.android.api.session.events.model.Event
|
|||||||
import im.vector.matrix.android.api.session.events.model.EventType
|
import im.vector.matrix.android.api.session.events.model.EventType
|
||||||
import im.vector.matrix.android.api.session.events.model.toModel
|
import im.vector.matrix.android.api.session.events.model.toModel
|
||||||
import im.vector.matrix.android.api.session.room.model.message.MessageContent
|
import im.vector.matrix.android.api.session.room.model.message.MessageContent
|
||||||
import im.vector.matrix.android.api.session.room.timeline.TimelineEvent
|
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import java.util.regex.Pattern
|
import java.util.regex.Pattern
|
||||||
|
|
||||||
@ -35,15 +34,15 @@ class ContainsDisplayNameCondition : Condition(Kind.contains_display_name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun isSatisfied(event: Event, displayName: String): Boolean {
|
fun isSatisfied(event: Event, displayName: String): Boolean {
|
||||||
//TODO the spec says:
|
|
||||||
// Matches any message whose content is unencrypted and contains the user's current display name
|
|
||||||
var message = when (event.type) {
|
var message = when (event.type) {
|
||||||
EventType.MESSAGE -> {
|
EventType.MESSAGE -> {
|
||||||
event.content.toModel<MessageContent>()
|
event.content.toModel<MessageContent>()
|
||||||
}
|
}
|
||||||
// EventType.ENCRYPTED -> {
|
//TODO the spec says:
|
||||||
// event.root.getClearContent()?.toModel<MessageContent>()
|
// Matches any message whose content is unencrypted and contains the user's current display name
|
||||||
// }
|
// EventType.ENCRYPTED -> {
|
||||||
|
// event.root.getClearContent()?.toModel<MessageContent>()
|
||||||
|
// }
|
||||||
else -> null
|
else -> null
|
||||||
} ?: return false
|
} ?: return false
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ internal abstract class CryptoModule {
|
|||||||
@Provides
|
@Provides
|
||||||
fun providesCryptoStore(@CryptoDatabase
|
fun providesCryptoStore(@CryptoDatabase
|
||||||
realmConfiguration: RealmConfiguration, credentials: Credentials): IMXCryptoStore {
|
realmConfiguration: RealmConfiguration, credentials: Credentials): IMXCryptoStore {
|
||||||
return RealmCryptoStore(false /* TODO*/,
|
return RealmCryptoStore(
|
||||||
realmConfiguration,
|
realmConfiguration,
|
||||||
credentials)
|
credentials)
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ internal class IncomingRoomKeyRequestManager @Inject constructor(
|
|||||||
Timber.e("## processReceivedRoomKeyRequests() : Ignoring room key request from other user for now")
|
Timber.e("## processReceivedRoomKeyRequests() : Ignoring room key request from other user for now")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// todo: should we queue up requests we don't yet have keys for, in case they turn up later?
|
// TODO: should we queue up requests we don't yet have keys for, in case they turn up later?
|
||||||
// if we don't have a decryptor for this room/alg, we don't have
|
// if we don't have a decryptor for this room/alg, we don't have
|
||||||
// the keys for the requested events, and can drop the requests.
|
// the keys for the requested events, and can drop the requests.
|
||||||
val decryptor = roomDecryptorProvider.getRoomDecryptor(roomId, alg)
|
val decryptor = roomDecryptorProvider.getRoomDecryptor(roomId, alg)
|
||||||
|
@ -285,7 +285,8 @@ internal class OutgoingRoomKeyRequestManager @Inject constructor(
|
|||||||
val contentMap = MXUsersDevicesMap<Any>()
|
val contentMap = MXUsersDevicesMap<Any>()
|
||||||
|
|
||||||
for (recipient in recipients) {
|
for (recipient in recipients) {
|
||||||
contentMap.setObject(message, recipient["userId"], recipient["deviceId"]) // TODO Change this two hard coded key to something better
|
// TODO Change this two hard coded key to something better
|
||||||
|
contentMap.setObject(message, recipient["userId"], recipient["deviceId"])
|
||||||
}
|
}
|
||||||
|
|
||||||
sendToDeviceTask.configureWith(SendToDeviceTask.Params(EventType.ROOM_KEY_REQUEST, contentMap, transactionId))
|
sendToDeviceTask.configureWith(SendToDeviceTask.Params(EventType.ROOM_KEY_REQUEST, contentMap, transactionId))
|
||||||
|
@ -81,9 +81,6 @@ internal class MessageEncrypter @Inject constructor(private val credentials: Cre
|
|||||||
recipientsKeysMap["ed25519"] = deviceInfo.fingerprint()!!
|
recipientsKeysMap["ed25519"] = deviceInfo.fingerprint()!!
|
||||||
payloadJson["recipient_keys"] = recipientsKeysMap
|
payloadJson["recipient_keys"] = recipientsKeysMap
|
||||||
|
|
||||||
// FIXME We have to canonicalize the JSON
|
|
||||||
//JsonUtility.canonicalize(JsonUtility.getGson(false).toJsonTree(payloadJson)).toString()
|
|
||||||
|
|
||||||
val payloadString = convertToUTF8(MoshiProvider.getCanonicalJson(Map::class.java, payloadJson))
|
val payloadString = convertToUTF8(MoshiProvider.getCanonicalJson(Map::class.java, payloadJson))
|
||||||
ciphertext[deviceKey] = olmDevice.encryptMessage(deviceKey, sessionId!!, payloadString!!)!!
|
ciphertext[deviceKey] = olmDevice.encryptMessage(deviceKey, sessionId!!, payloadString!!)!!
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,8 @@ internal class MXMegolmDecryption(private val credentials: Credentials,
|
|||||||
val recipients = ArrayList<Map<String, String>>()
|
val recipients = ArrayList<Map<String, String>>()
|
||||||
|
|
||||||
val selfMap = HashMap<String, String>()
|
val selfMap = HashMap<String, String>()
|
||||||
selfMap["userId"] = credentials.userId // TODO Replace this hard coded keys (see OutgoingRoomKeyRequestManager)
|
// TODO Replace this hard coded keys (see OutgoingRoomKeyRequestManager)
|
||||||
|
selfMap["userId"] = credentials.userId
|
||||||
selfMap["deviceId"] = "*"
|
selfMap["deviceId"] = "*"
|
||||||
recipients.add(selfMap)
|
recipients.add(selfMap)
|
||||||
|
|
||||||
|
@ -25,8 +25,6 @@ import im.vector.matrix.android.internal.crypto.keysbackup.KeysBackup
|
|||||||
import im.vector.matrix.android.internal.crypto.repository.WarnOnUnknownDeviceRepository
|
import im.vector.matrix.android.internal.crypto.repository.WarnOnUnknownDeviceRepository
|
||||||
import im.vector.matrix.android.internal.crypto.store.IMXCryptoStore
|
import im.vector.matrix.android.internal.crypto.store.IMXCryptoStore
|
||||||
import im.vector.matrix.android.internal.crypto.tasks.SendToDeviceTask
|
import im.vector.matrix.android.internal.crypto.tasks.SendToDeviceTask
|
||||||
import im.vector.matrix.android.internal.session.SessionScope
|
|
||||||
import im.vector.matrix.android.internal.task.TaskExecutor
|
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
internal class MXMegolmEncryptionFactory @Inject constructor(
|
internal class MXMegolmEncryptionFactory @Inject constructor(
|
||||||
@ -37,8 +35,6 @@ internal class MXMegolmEncryptionFactory @Inject constructor(
|
|||||||
private val ensureOlmSessionsForDevicesAction: EnsureOlmSessionsForDevicesAction,
|
private val ensureOlmSessionsForDevicesAction: EnsureOlmSessionsForDevicesAction,
|
||||||
private val credentials: Credentials,
|
private val credentials: Credentials,
|
||||||
private val sendToDeviceTask: SendToDeviceTask,
|
private val sendToDeviceTask: SendToDeviceTask,
|
||||||
// FIXME Why taskExecutor is not used?
|
|
||||||
private val taskExecutor: TaskExecutor,
|
|
||||||
private val messageEncrypter: MessageEncrypter,
|
private val messageEncrypter: MessageEncrypter,
|
||||||
private val warnOnUnknownDevicesRepository: WarnOnUnknownDeviceRepository) {
|
private val warnOnUnknownDevicesRepository: WarnOnUnknownDeviceRepository) {
|
||||||
|
|
||||||
|
@ -39,10 +39,8 @@ import org.matrix.olm.OlmException
|
|||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import kotlin.collections.set
|
import kotlin.collections.set
|
||||||
|
|
||||||
// enableFileEncryption is used to migrate the previous store
|
|
||||||
@SessionScope
|
@SessionScope
|
||||||
internal class RealmCryptoStore(private val enableFileEncryption: Boolean = false,
|
internal class RealmCryptoStore(private val realmConfiguration: RealmConfiguration,
|
||||||
private val realmConfiguration: RealmConfiguration,
|
|
||||||
private val credentials: Credentials) : IMXCryptoStore {
|
private val credentials: Credentials) : IMXCryptoStore {
|
||||||
|
|
||||||
/* ==========================================================================================
|
/* ==========================================================================================
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2019 New Vector Ltd
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// TODO When upgrading to koin 2.0
|
|
||||||
/*
|
|
||||||
class ModuleTest : KoinTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
fun checkModules() {
|
|
||||||
startKoin {
|
|
||||||
listOf(CryptoModule().definition)
|
|
||||||
}.checkModules()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
@ -166,6 +166,7 @@ class PushrulesConditionTest {
|
|||||||
|
|
||||||
|
|
||||||
class MockRoomService() : RoomService {
|
class MockRoomService() : RoomService {
|
||||||
|
|
||||||
override fun createRoom(createRoomParams: CreateRoomParams, callback: MatrixCallback<String>) {
|
override fun createRoom(createRoomParams: CreateRoomParams, callback: MatrixCallback<String>) {
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -178,24 +179,28 @@ class PushrulesConditionTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun liveRoomSummaries(): LiveData<List<RoomSummary>> {
|
override fun liveRoomSummaries(fetchLastEvents: Boolean): LiveData<List<RoomSummary>> {
|
||||||
return MutableLiveData()
|
return MutableLiveData()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class MockRoom(override val roomId: String, val _numberOfJoinedMembers: Int) : Room {
|
class MockRoom(override val roomId: String, val _numberOfJoinedMembers: Int) : Room {
|
||||||
|
override fun liveTimeLineEvent(eventId: String): LiveData<TimelineEvent> {
|
||||||
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun getNumberOfJoinedMembers(): Int {
|
override fun getNumberOfJoinedMembers(): Int {
|
||||||
return _numberOfJoinedMembers
|
return _numberOfJoinedMembers
|
||||||
}
|
}
|
||||||
|
|
||||||
override val liveRoomSummary: LiveData<RoomSummary>
|
override fun liveRoomSummary(fetchLastEvent: Boolean): LiveData<RoomSummary> {
|
||||||
get() = TODO("not implemented") //To change initializer of created properties use File | Settings | File Templates.
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
|
}
|
||||||
|
|
||||||
override val roomSummary: RoomSummary?
|
override fun roomSummary(fetchLastEvent: Boolean): RoomSummary? {
|
||||||
get() = TODO("not implemented") //To change initializer of created properties use File | Settings | File Templates.
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
|
}
|
||||||
|
|
||||||
override fun createTimeline(eventId: String?, allowedTypes: List<String>?): Timeline {
|
override fun createTimeline(eventId: String?, allowedTypes: List<String>?): Timeline {
|
||||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
@ -277,10 +282,6 @@ class PushrulesConditionTest {
|
|||||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateQuickReaction(reaction: String, oppositeReaction: String, targetEventId: String, myUserId: String) {
|
|
||||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun editTextMessage(targetEventId: String, newBodyText: String, newBodyAutoMarkdown: Boolean, compatibilityBodyText: String): Cancelable {
|
override fun editTextMessage(targetEventId: String, newBodyText: String, newBodyAutoMarkdown: Boolean, compatibilityBodyText: String): Cancelable {
|
||||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
}
|
}
|
||||||
@ -289,7 +290,7 @@ class PushrulesConditionTest {
|
|||||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getEventSummaryLive(eventId: String): LiveData<List<EventAnnotationsSummary>> {
|
override fun getEventSummaryLive(eventId: String): LiveData<EventAnnotationsSummary> {
|
||||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,8 +105,7 @@ fi
|
|||||||
echo
|
echo
|
||||||
echo "Search for long files..."
|
echo "Search for long files..."
|
||||||
|
|
||||||
# TODO Reduce this once VectorSettingsPreferencesFragment.kt has been reworked
|
${checkLongFilesScript} 2000 \
|
||||||
${checkLongFilesScript} 3500 \
|
|
||||||
./vector/src/main/java \
|
./vector/src/main/java \
|
||||||
./vector/src/main/res/layout \
|
./vector/src/main/res/layout \
|
||||||
./vector/src/main/res/values \
|
./vector/src/main/res/values \
|
||||||
|
@ -45,7 +45,6 @@ abstract class MessageTextItem : AbsMessageItem<MessageTextItem.Holder>() {
|
|||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var urlClickCallback: TimelineEventController.UrlClickCallback? = null
|
var urlClickCallback: TimelineEventController.UrlClickCallback? = null
|
||||||
|
|
||||||
// TODO Move this instantiation somewhere else?
|
|
||||||
private val mvmtMethod = BetterLinkMovementMethod.newInstance().also {
|
private val mvmtMethod = BetterLinkMovementMethod.newInstance().also {
|
||||||
it.setOnLinkClickListener { _, url ->
|
it.setOnLinkClickListener { _, url ->
|
||||||
//Return false to let android manage the click on the link, or true if the link is handled by the application
|
//Return false to let android manage the click on the link, or true if the link is handled by the application
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<!-- TODO Design: icon -->
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/bottom_action_home"
|
android:id="@+id/bottom_action_home"
|
||||||
android:contentDescription="@string/bottom_action_home"
|
android:contentDescription="@string/bottom_action_home"
|
||||||
|
Loading…
Reference in New Issue
Block a user