From 9c42e277221d5491d41e0afd922c998a3ad8db74 Mon Sep 17 00:00:00 2001 From: Taras Smakula <tarassmakula@gmail.com> Date: Wed, 3 Jan 2024 13:58:12 +0200 Subject: [PATCH] Rename to manege invite requests ds --- .../core/feature/room/invite/InviteMembersViewModel.kt | 2 +- ...stsDataSource.kt => ManageInviteRequestsDataSource.kt} | 2 +- .../circles/core/feature/room/invites/InvitesViewModel.kt | 8 ++++---- .../core/feature/room/knoks/KnockRequestViewModel.kt | 8 ++++---- .../org/futo/circles/core/feature/user/UserViewModel.kt | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) rename core/src/main/java/org/futo/circles/core/feature/room/invite/{InviteRequestsDataSource.kt => ManageInviteRequestsDataSource.kt} (97%) diff --git a/core/src/main/java/org/futo/circles/core/feature/room/invite/InviteMembersViewModel.kt b/core/src/main/java/org/futo/circles/core/feature/room/invite/InviteMembersViewModel.kt index 858de5c47..0be33a104 100644 --- a/core/src/main/java/org/futo/circles/core/feature/room/invite/InviteMembersViewModel.kt +++ b/core/src/main/java/org/futo/circles/core/feature/room/invite/InviteMembersViewModel.kt @@ -18,7 +18,7 @@ import javax.inject.Inject @HiltViewModel class InviteMembersViewModel @Inject constructor( savedStateHandle: SavedStateHandle, - private val dataSource: InviteRequestsDataSource + private val dataSource: ManageInviteRequestsDataSource ) : ViewModel() { private val roomId: String = savedStateHandle.getOrThrow("roomId") diff --git a/core/src/main/java/org/futo/circles/core/feature/room/invite/InviteRequestsDataSource.kt b/core/src/main/java/org/futo/circles/core/feature/room/invite/ManageInviteRequestsDataSource.kt similarity index 97% rename from core/src/main/java/org/futo/circles/core/feature/room/invite/InviteRequestsDataSource.kt rename to core/src/main/java/org/futo/circles/core/feature/room/invite/ManageInviteRequestsDataSource.kt index 07e9ce33c..df6498bcd 100644 --- a/core/src/main/java/org/futo/circles/core/feature/room/invite/InviteRequestsDataSource.kt +++ b/core/src/main/java/org/futo/circles/core/feature/room/invite/ManageInviteRequestsDataSource.kt @@ -14,7 +14,7 @@ import org.matrix.android.sdk.api.session.getRoom import javax.inject.Inject @ViewModelScoped -class InviteRequestsDataSource @Inject constructor( +class ManageInviteRequestsDataSource @Inject constructor( private val roomRelationsBuilder: RoomRelationsBuilder ) { diff --git a/core/src/main/java/org/futo/circles/core/feature/room/invites/InvitesViewModel.kt b/core/src/main/java/org/futo/circles/core/feature/room/invites/InvitesViewModel.kt index a8443ab68..bc0ab872e 100644 --- a/core/src/main/java/org/futo/circles/core/feature/room/invites/InvitesViewModel.kt +++ b/core/src/main/java/org/futo/circles/core/feature/room/invites/InvitesViewModel.kt @@ -8,7 +8,7 @@ import org.futo.circles.core.base.SingleEventLiveData import org.futo.circles.core.extensions.Response import org.futo.circles.core.extensions.getOrThrow import org.futo.circles.core.extensions.launchBg -import org.futo.circles.core.feature.room.invite.InviteRequestsDataSource +import org.futo.circles.core.feature.room.invite.ManageInviteRequestsDataSource import org.futo.circles.core.model.CircleRoomTypeArg import org.futo.circles.core.model.InviteTypeArg import javax.inject.Inject @@ -17,7 +17,7 @@ import javax.inject.Inject class InvitesViewModel @Inject constructor( savedStateHandle: SavedStateHandle, private val dataSource: InvitesDataSource, - private val inviteRequestsDataSource: InviteRequestsDataSource + private val manageInviteRequestsDataSource: ManageInviteRequestsDataSource ) : ViewModel() { private val inviteType: InviteTypeArg = savedStateHandle.getOrThrow("type") @@ -29,14 +29,14 @@ class InvitesViewModel @Inject constructor( fun rejectRoomInvite(roomId: String) { launchBg { - val result = inviteRequestsDataSource.rejectInvite(roomId) + val result = manageInviteRequestsDataSource.rejectInvite(roomId) inviteResultLiveData.postValue(result) } } fun acceptRoomInvite(roomId: String, roomType: CircleRoomTypeArg) { launchBg { - val result = inviteRequestsDataSource.acceptInvite(roomId, roomType) + val result = manageInviteRequestsDataSource.acceptInvite(roomId, roomType) inviteResultLiveData.postValue(result) } } diff --git a/core/src/main/java/org/futo/circles/core/feature/room/knoks/KnockRequestViewModel.kt b/core/src/main/java/org/futo/circles/core/feature/room/knoks/KnockRequestViewModel.kt index 9887aca60..fc6c48a17 100644 --- a/core/src/main/java/org/futo/circles/core/feature/room/knoks/KnockRequestViewModel.kt +++ b/core/src/main/java/org/futo/circles/core/feature/room/knoks/KnockRequestViewModel.kt @@ -7,14 +7,14 @@ import org.futo.circles.core.base.SingleEventLiveData import org.futo.circles.core.extensions.Response import org.futo.circles.core.extensions.getOrThrow import org.futo.circles.core.extensions.launchBg -import org.futo.circles.core.feature.room.invite.InviteRequestsDataSource +import org.futo.circles.core.feature.room.invite.ManageInviteRequestsDataSource import org.futo.circles.core.model.KnockRequestListItem import javax.inject.Inject @HiltViewModel class KnockRequestViewModel @Inject constructor( savedStateHandle: SavedStateHandle, - private val inviteRequestsDataSource: InviteRequestsDataSource, + private val manageInviteRequestsDataSource: ManageInviteRequestsDataSource, knockRequestsDataSource: KnockRequestsDataSource ) : ViewModel() { @@ -25,13 +25,13 @@ class KnockRequestViewModel @Inject constructor( fun inviteUser(user: KnockRequestListItem) { launchBg { - val result = inviteRequestsDataSource.inviteUser(roomId, user.requesterId) + val result = manageInviteRequestsDataSource.inviteUser(roomId, user.requesterId) inviteResultLiveData.postValue(result) } } fun kickUser(user: KnockRequestListItem) { - launchBg { inviteRequestsDataSource.kickUser(roomId, user.requesterId) } + launchBg { manageInviteRequestsDataSource.kickUser(roomId, user.requesterId) } } } diff --git a/core/src/main/java/org/futo/circles/core/feature/user/UserViewModel.kt b/core/src/main/java/org/futo/circles/core/feature/user/UserViewModel.kt index a4b6a082a..e8923ab3b 100644 --- a/core/src/main/java/org/futo/circles/core/feature/user/UserViewModel.kt +++ b/core/src/main/java/org/futo/circles/core/feature/user/UserViewModel.kt @@ -13,7 +13,7 @@ import org.futo.circles.core.extensions.getOrThrow import org.futo.circles.core.extensions.launchBg import org.futo.circles.core.extensions.launchUi import org.futo.circles.core.feature.room.RoomRelationsBuilder -import org.futo.circles.core.feature.room.invite.InviteRequestsDataSource +import org.futo.circles.core.feature.room.invite.ManageInviteRequestsDataSource import org.futo.circles.core.feature.workspace.SharedCircleDataSource import org.futo.circles.core.model.TimelineListItem import org.futo.circles.core.provider.MatrixSessionProvider @@ -26,7 +26,7 @@ class UserViewModel @Inject constructor( private val userDataSource: UserDataSource, private val userOptionsDataSource: UserOptionsDataSource, private val roomRelationsBuilder: RoomRelationsBuilder, - private val inviteRequestsDataSource: InviteRequestsDataSource, + private val manageInviteRequestsDataSource: ManageInviteRequestsDataSource, sharedCircleDataSource: SharedCircleDataSource ) : ViewModel() { @@ -103,7 +103,7 @@ class UserViewModel @Inject constructor( fun inviteToMySharedCircle() { launchBg { - val result = inviteRequestsDataSource.inviteUser(profileRoomId, userId) + val result = manageInviteRequestsDataSource.inviteUser(profileRoomId, userId) inviteToConnectLiveData.postValue(result) } } -- GitLab