Skip to content

Commit

Permalink
Revert "feat: add usecase to get team url (WPB-14872) (#3157)"
Browse files Browse the repository at this point in the history
This reverts commit 66253da.
  • Loading branch information
ohassine committed Dec 11, 2024
1 parent 66253da commit c570bc8
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ interface ServerConfigRepository {
*/
suspend fun configForUser(userId: UserId): Either<StorageFailure, ServerConfig>
suspend fun commonApiVersion(domain: String): Either<CoreFailure, Int>
suspend fun getTeamUrlForUser(userId: UserId): String?
}

@Suppress("LongParameterList", "TooManyFunctions")
Expand Down Expand Up @@ -166,6 +165,4 @@ internal class ServerConfigDataSource(
is ApiVersionDTO.Valid -> Either.Right(it)
}
}.map { serverConfigMapper.fromDTO(it) }

override suspend fun getTeamUrlForUser(userId: UserId): String? = dao.teamUrlForUser(userId.toDao())
}
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ import com.wire.kalium.logic.feature.selfDeletingMessages.ObserveSelfDeletionTim
import com.wire.kalium.logic.feature.selfDeletingMessages.ObserveTeamSettingsSelfDeletingStatusUseCase
import com.wire.kalium.logic.feature.selfDeletingMessages.ObserveTeamSettingsSelfDeletingStatusUseCaseImpl
import com.wire.kalium.logic.feature.selfDeletingMessages.PersistNewSelfDeletionTimerUseCaseImpl
import com.wire.kalium.logic.feature.server.GetTeamUrlUseCase
import com.wire.kalium.logic.feature.service.ServiceScope
import com.wire.kalium.logic.feature.session.GetProxyCredentialsUseCase
import com.wire.kalium.logic.feature.session.GetProxyCredentialsUseCaseImpl
Expand Down Expand Up @@ -2145,13 +2144,6 @@ class UserSessionScope internal constructor(
kaliumLogger = userScopedLogger,
)

val getTeamUrlUseCase: GetTeamUrlUseCase by lazy {
GetTeamUrlUseCase(
userId,
authenticationScope.serverConfigRepository,
)
}

/**
* This will start subscribers of observable work per user session, as long as the user is logged in.
* When the user logs out, this work will be canceled.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ SELECT * FROM ServerConfiguration WHERE title = ? AND apiBaseUrl = ? AND webSock
getByUser:
SELECT * FROM ServerConfiguration WHERE id = (SELECT server_config_id FROM Accounts WHERE id = :userId);

getTeamUrlByUser:
SELECT teamsUrl FROM ServerConfiguration WHERE id = (SELECT server_config_id FROM Accounts WHERE id = :userId);

getServerConfigsWithAccIdWithLastCheckBeforeDate:
SELECT sc.*, acc.id
FROM Accounts AS acc LEFT JOIN ServerConfiguration AS sc ON acc.server_config_id == sc.id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ internal object ServerConfigMapper {
)
}

@Suppress("TooManyFunctions")
interface ServerConfigurationDAO {
suspend fun deleteById(id: String)
suspend fun insert(insertData: InsertData)
Expand All @@ -130,7 +129,6 @@ interface ServerConfigurationDAO {
suspend fun updateServerMetaData(id: String, federation: Boolean, commonApiVersion: Int)
suspend fun updateApiVersionAndDomain(id: String, domain: String, commonApiVersion: Int)
suspend fun configForUser(userId: UserIDEntity): ServerConfigEntity?
suspend fun teamUrlForUser(userId: UserIDEntity): String?
suspend fun setFederationToTrue(id: String)
suspend fun getServerConfigsWithAccIdWithLastCheckBeforeDate(date: String): Flow<List<ServerConfigWithUserIdEntity>>
suspend fun updateBlackListCheckDate(configIds: Set<String>, date: String)
Expand All @@ -154,7 +152,6 @@ interface ServerConfigurationDAO {
)
}

@Suppress("TooManyFunctions")
internal class ServerConfigurationDAOImpl internal constructor(
private val queries: ServerConfigurationQueries,
private val queriesContext: CoroutineContext,
Expand Down Expand Up @@ -243,8 +240,4 @@ internal class ServerConfigurationDAOImpl internal constructor(
override suspend fun updateBlackListCheckDate(configIds: Set<String>, date: String) = withContext(queriesContext) {
queries.updateLastBlackListCheckByIds(date, configIds)
}

override suspend fun teamUrlForUser(userId: UserIDEntity): String? = withContext(queriesContext) {
queries.getTeamUrlByUser(userId).executeAsOneOrNull()
}
}

0 comments on commit c570bc8

Please sign in to comment.