Rename matrix modules

This commit is contained in:
ganfra 2023-01-20 17:27:47 +01:00
parent bbbbc3495d
commit 907d7eba75
87 changed files with 217 additions and 219 deletions

View file

@ -23,7 +23,7 @@ plugins {
}
android {
namespace = "io.element.android.x.matrix"
namespace = "io.element.android.libraries.matrix"
}
anvil {

View file

@ -14,6 +14,6 @@
* limitations under the License.
*/
package io.element.android.x.matrix
package io.element.android.libraries.matrix
internal const val LOG_TAG = "Matrix"

View file

@ -14,14 +14,14 @@
* limitations under the License.
*/
package io.element.android.x.matrix
package io.element.android.libraries.matrix
import io.element.android.x.matrix.core.RoomId
import io.element.android.x.matrix.core.SessionId
import io.element.android.x.matrix.core.UserId
import io.element.android.x.matrix.media.MediaResolver
import io.element.android.x.matrix.room.MatrixRoom
import io.element.android.x.matrix.room.RoomSummaryDataSource
import io.element.android.libraries.matrix.core.RoomId
import io.element.android.libraries.matrix.core.SessionId
import io.element.android.libraries.matrix.core.UserId
import io.element.android.libraries.matrix.media.MediaResolver
import io.element.android.libraries.matrix.room.MatrixRoom
import io.element.android.libraries.matrix.room.RoomSummaryDataSource
import org.matrix.rustcomponents.sdk.MediaSource
import java.io.Closeable

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* Copyright (c) 2023 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.
@ -14,22 +14,22 @@
* limitations under the License.
*/
package io.element.android.x.matrix
package io.element.android.libraries.matrix
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
import io.element.android.x.matrix.core.RoomId
import io.element.android.x.matrix.core.SessionId
import io.element.android.x.matrix.core.UserId
import io.element.android.x.matrix.media.MediaResolver
import io.element.android.x.matrix.media.RustMediaResolver
import io.element.android.x.matrix.room.MatrixRoom
import io.element.android.x.matrix.room.RoomSummaryDataSource
import io.element.android.x.matrix.room.RustMatrixRoom
import io.element.android.x.matrix.room.RustRoomSummaryDataSource
import io.element.android.x.matrix.session.PreferencesSessionStore
import io.element.android.x.matrix.session.SessionStore
import io.element.android.x.matrix.session.sessionId
import io.element.android.x.matrix.sync.SlidingSyncObserverProxy
import io.element.android.libraries.matrix.core.RoomId
import io.element.android.libraries.matrix.core.SessionId
import io.element.android.libraries.matrix.core.UserId
import io.element.android.libraries.matrix.media.MediaResolver
import io.element.android.libraries.matrix.media.RustMediaResolver
import io.element.android.libraries.matrix.room.MatrixRoom
import io.element.android.libraries.matrix.room.RoomSummaryDataSource
import io.element.android.libraries.matrix.room.RustMatrixRoom
import io.element.android.libraries.matrix.room.RustRoomSummaryDataSource
import io.element.android.libraries.matrix.session.PreferencesSessionStore
import io.element.android.libraries.matrix.session.SessionStore
import io.element.android.libraries.matrix.session.sessionId
import io.element.android.libraries.matrix.sync.SlidingSyncObserverProxy
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.withContext
import org.matrix.rustcomponents.sdk.Client

View file

@ -14,10 +14,10 @@
* limitations under the License.
*/
package io.element.android.x.matrix.auth
package io.element.android.libraries.matrix.auth
import io.element.android.x.matrix.MatrixClient
import io.element.android.x.matrix.core.SessionId
import io.element.android.libraries.matrix.MatrixClient
import io.element.android.libraries.matrix.core.SessionId
import kotlinx.coroutines.flow.Flow
interface MatrixAuthenticationService {

View file

@ -14,17 +14,17 @@
* limitations under the License.
*/
package io.element.android.x.matrix.auth
package io.element.android.libraries.matrix.auth
import com.squareup.anvil.annotations.ContributesBinding
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
import io.element.android.libraries.di.AppScope
import io.element.android.x.matrix.MatrixClient
import io.element.android.x.matrix.RustMatrixClient
import io.element.android.x.matrix.core.SessionId
import io.element.android.x.matrix.session.SessionStore
import io.element.android.x.matrix.session.sessionId
import io.element.android.x.matrix.util.logError
import io.element.android.libraries.matrix.MatrixClient
import io.element.android.libraries.matrix.RustMatrixClient
import io.element.android.libraries.matrix.core.SessionId
import io.element.android.libraries.matrix.session.SessionStore
import io.element.android.libraries.matrix.session.sessionId
import io.element.android.libraries.matrix.util.logError
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.withContext

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.core
package io.element.android.libraries.matrix.core
import java.io.Serializable

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* Copyright (c) 2023 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.
@ -14,9 +14,9 @@
* limitations under the License.
*/
package io.element.android.x.matrix.core
package io.element.android.libraries.matrix.core
import io.element.android.x.matrix.BuildConfig
import io.element.android.libraries.matrix.BuildConfig
import timber.log.Timber
/**

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.core
package io.element.android.libraries.matrix.core
import java.io.Serializable

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.core
package io.element.android.libraries.matrix.core
import java.io.Serializable

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.core
package io.element.android.libraries.matrix.core
import java.io.Serializable

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.di
package io.element.android.libraries.matrix.di
import com.squareup.anvil.annotations.ContributesTo
import dagger.Module

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.media
package io.element.android.libraries.matrix.media
import org.matrix.rustcomponents.sdk.MediaSource

View file

@ -14,9 +14,9 @@
* limitations under the License.
*/
package io.element.android.x.matrix.media
package io.element.android.libraries.matrix.media
import io.element.android.x.matrix.MatrixClient
import io.element.android.libraries.matrix.MatrixClient
import org.matrix.rustcomponents.sdk.mediaSourceFromUrl
internal class RustMediaResolver(private val client: MatrixClient) : MediaResolver {

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.permalink
package io.element.android.libraries.matrix.permalink
import android.net.Uri

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.permalink
package io.element.android.libraries.matrix.permalink
import android.net.Uri

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* Copyright (c) 2023 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.
@ -14,11 +14,11 @@
* limitations under the License.
*/
package io.element.android.x.matrix.permalink
package io.element.android.libraries.matrix.permalink
import android.net.Uri
import android.net.UrlQuerySanitizer
import io.element.android.x.matrix.core.MatrixPatterns
import io.element.android.libraries.matrix.core.MatrixPatterns
import java.net.URLDecoder
import timber.log.Timber

View file

@ -14,11 +14,11 @@
* limitations under the License.
*/
package io.element.android.x.matrix.room
package io.element.android.libraries.matrix.room
import io.element.android.x.matrix.core.EventId
import io.element.android.x.matrix.core.RoomId
import io.element.android.x.matrix.timeline.MatrixTimeline
import io.element.android.libraries.matrix.core.EventId
import io.element.android.libraries.matrix.core.RoomId
import io.element.android.libraries.matrix.timeline.MatrixTimeline
import kotlinx.coroutines.flow.Flow
interface MatrixRoom {

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.room
package io.element.android.libraries.matrix.room
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.channels.awaitClose

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* Copyright (c) 2023 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.
@ -14,9 +14,9 @@
* limitations under the License.
*/
package io.element.android.x.matrix.room
package io.element.android.libraries.matrix.room
import io.element.android.x.matrix.core.RoomId
import io.element.android.libraries.matrix.core.RoomId
sealed interface RoomSummary {
data class Empty(val identifier: String) : RoomSummary

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* Copyright (c) 2023 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.
@ -14,11 +14,11 @@
* limitations under the License.
*/
package io.element.android.x.matrix.room
package io.element.android.libraries.matrix.room
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
import io.element.android.x.matrix.sync.roomListDiff
import io.element.android.x.matrix.sync.state
import io.element.android.libraries.matrix.sync.roomListDiff
import io.element.android.libraries.matrix.sync.state
import java.io.Closeable
import java.util.Collections
import java.util.UUID

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* Copyright (c) 2023 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.
@ -14,10 +14,10 @@
* limitations under the License.
*/
package io.element.android.x.matrix.room
package io.element.android.libraries.matrix.room
import io.element.android.x.matrix.core.RoomId
import io.element.android.x.matrix.room.message.RoomMessageFactory
import io.element.android.libraries.matrix.core.RoomId
import io.element.android.libraries.matrix.room.message.RoomMessageFactory
import org.matrix.rustcomponents.sdk.Room
import org.matrix.rustcomponents.sdk.SlidingSyncRoom

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* Copyright (c) 2023 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.
@ -14,13 +14,13 @@
* limitations under the License.
*/
package io.element.android.x.matrix.room
package io.element.android.libraries.matrix.room
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
import io.element.android.x.matrix.core.EventId
import io.element.android.x.matrix.core.RoomId
import io.element.android.x.matrix.timeline.MatrixTimeline
import io.element.android.x.matrix.timeline.RustMatrixTimeline
import io.element.android.libraries.matrix.core.EventId
import io.element.android.libraries.matrix.core.RoomId
import io.element.android.libraries.matrix.timeline.MatrixTimeline
import io.element.android.libraries.matrix.timeline.RustMatrixTimeline
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.filter

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* Copyright (c) 2023 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.
@ -14,10 +14,10 @@
* limitations under the License.
*/
package io.element.android.x.matrix.room.message
package io.element.android.libraries.matrix.room.message
import io.element.android.x.matrix.core.EventId
import io.element.android.x.matrix.core.UserId
import io.element.android.libraries.matrix.core.EventId
import io.element.android.libraries.matrix.core.UserId
data class RoomMessage(
val eventId: EventId,

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* Copyright (c) 2023 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.
@ -14,10 +14,10 @@
* limitations under the License.
*/
package io.element.android.x.matrix.room.message
package io.element.android.libraries.matrix.room.message
import io.element.android.x.matrix.core.EventId
import io.element.android.x.matrix.core.UserId
import io.element.android.libraries.matrix.core.EventId
import io.element.android.libraries.matrix.core.UserId
import org.matrix.rustcomponents.sdk.EventTimelineItem
class RoomMessageFactory {

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.session
package io.element.android.libraries.matrix.session
import android.content.Context
import androidx.datastore.core.DataStore

View file

@ -14,9 +14,9 @@
* limitations under the License.
*/
package io.element.android.x.matrix.session
package io.element.android.libraries.matrix.session
import io.element.android.x.matrix.core.SessionId
import io.element.android.libraries.matrix.core.SessionId
import org.matrix.rustcomponents.sdk.Session
fun Session.sessionId() = SessionId("${userId}_${deviceId}")

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.session
package io.element.android.libraries.matrix.session
import kotlinx.coroutines.flow.Flow
import org.matrix.rustcomponents.sdk.Session

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.sync
package io.element.android.libraries.matrix.sync
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
import kotlinx.coroutines.CoroutineScope

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* Copyright (c) 2023 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.
@ -14,9 +14,9 @@
* limitations under the License.
*/
package io.element.android.x.matrix.sync
package io.element.android.libraries.matrix.sync
import io.element.android.x.matrix.util.mxCallbackFlow
import io.element.android.libraries.matrix.util.mxCallbackFlow
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.launch

View file

@ -14,9 +14,9 @@
* limitations under the License.
*/
package io.element.android.x.matrix.timeline
package io.element.android.libraries.matrix.timeline
import io.element.android.x.matrix.core.EventId
import io.element.android.libraries.matrix.core.EventId
import kotlinx.coroutines.flow.Flow
import org.matrix.rustcomponents.sdk.TimelineListener

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.timeline
package io.element.android.libraries.matrix.timeline
import org.matrix.rustcomponents.sdk.EventTimelineItem
import org.matrix.rustcomponents.sdk.TimelineItem

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* Copyright (c) 2023 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.
@ -14,11 +14,11 @@
* limitations under the License.
*/
package io.element.android.x.matrix.timeline
package io.element.android.libraries.matrix.timeline
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
import io.element.android.x.matrix.core.EventId
import io.element.android.x.matrix.room.RustMatrixRoom
import io.element.android.libraries.matrix.core.EventId
import io.element.android.libraries.matrix.room.RustMatrixRoom
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.flow.Flow

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.tracing
package io.element.android.libraries.matrix.tracing
data class TracingConfiguration(
val common: LogLevel = LogLevel.Warn,

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.util
package io.element.android.libraries.matrix.util
import kotlinx.coroutines.channels.ProducerScope
import kotlinx.coroutines.channels.awaitClose

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.util
package io.element.android.libraries.matrix.util
import org.matrix.rustcomponents.sdk.ClientException
import timber.log.Timber