Rename var
This commit is contained in:
parent
a00e6fbb33
commit
9e075e9647
1 changed files with 4 additions and 4 deletions
|
|
@ -37,9 +37,9 @@ class MatrixUserRepository @Inject constructor(
|
||||||
) : UserRepository {
|
) : UserRepository {
|
||||||
|
|
||||||
override suspend fun search(query: String): Flow<List<UserSearchResult>> = flow {
|
override suspend fun search(query: String): Flow<List<UserSearchResult>> = flow {
|
||||||
// Manually add a fake result with the matrixId, if provided and not the local user
|
// If the search term is a MXID that's not ours, we'll show a 'fake' result for that user, then update it when we get search results.
|
||||||
val isAnotherUsersId = MatrixPatterns.isUserId(query) && !client.isMe(UserId(query))
|
val shouldQueryProfile = MatrixPatterns.isUserId(query) && !client.isMe(UserId(query))
|
||||||
if (isAnotherUsersId) {
|
if (shouldQueryProfile) {
|
||||||
emit(listOf(UserSearchResult(MatrixUser(UserId(query)))))
|
emit(listOf(UserSearchResult(MatrixUser(UserId(query)))))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -54,7 +54,7 @@ class MatrixUserRepository @Inject constructor(
|
||||||
.toMutableList()
|
.toMutableList()
|
||||||
|
|
||||||
// If the query is another user's MXID and the result doesn't contain that user ID, query the profile information explicitly
|
// If the query is another user's MXID and the result doesn't contain that user ID, query the profile information explicitly
|
||||||
if (isAnotherUsersId && results.none { it.matrixUser.userId.value == query }) {
|
if (shouldQueryProfile && results.none { it.matrixUser.userId.value == query }) {
|
||||||
results.add(
|
results.add(
|
||||||
0,
|
0,
|
||||||
dataSource.getProfile(UserId(query))
|
dataSource.getProfile(UserId(query))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue