WIP review
This commit is contained in:
parent
2626a761ea
commit
264bc52bcc
|
@ -17,6 +17,9 @@
|
||||||
package org.matrix.android.sdk.internal.session.room.alias
|
package org.matrix.android.sdk.internal.session.room.alias
|
||||||
|
|
||||||
import com.zhuinden.monarchy.Monarchy
|
import com.zhuinden.monarchy.Monarchy
|
||||||
|
import io.realm.Realm
|
||||||
|
import org.greenrobot.eventbus.EventBus
|
||||||
|
import org.matrix.android.sdk.api.extensions.tryOrNull
|
||||||
import org.matrix.android.sdk.api.util.Optional
|
import org.matrix.android.sdk.api.util.Optional
|
||||||
import org.matrix.android.sdk.internal.database.model.RoomSummaryEntity
|
import org.matrix.android.sdk.internal.database.model.RoomSummaryEntity
|
||||||
import org.matrix.android.sdk.internal.database.query.findByAlias
|
import org.matrix.android.sdk.internal.database.query.findByAlias
|
||||||
|
@ -24,9 +27,6 @@ import org.matrix.android.sdk.internal.di.SessionDatabase
|
||||||
import org.matrix.android.sdk.internal.network.executeRequest
|
import org.matrix.android.sdk.internal.network.executeRequest
|
||||||
import org.matrix.android.sdk.internal.session.room.RoomAPI
|
import org.matrix.android.sdk.internal.session.room.RoomAPI
|
||||||
import org.matrix.android.sdk.internal.task.Task
|
import org.matrix.android.sdk.internal.task.Task
|
||||||
import io.realm.Realm
|
|
||||||
import org.greenrobot.eventbus.EventBus
|
|
||||||
import timber.log.Timber
|
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
internal interface GetRoomIdByAliasTask : Task<GetRoomIdByAliasTask.Params, Optional<String>> {
|
internal interface GetRoomIdByAliasTask : Task<GetRoomIdByAliasTask.Params, Optional<String>> {
|
||||||
|
@ -51,14 +51,11 @@ internal class DefaultGetRoomIdByAliasTask @Inject constructor(
|
||||||
} else if (!params.searchOnServer) {
|
} else if (!params.searchOnServer) {
|
||||||
Optional.from<String>(null)
|
Optional.from<String>(null)
|
||||||
} else {
|
} else {
|
||||||
roomId = try {
|
roomId = tryOrNull("## Failed to get roomId from alias") {
|
||||||
executeRequest<RoomAliasDescription>(eventBus) {
|
executeRequest<RoomAliasDescription>(eventBus) {
|
||||||
apiCall = roomAPI.getRoomIdByAlias(params.roomAlias)
|
apiCall = roomAPI.getRoomIdByAlias(params.roomAlias)
|
||||||
}.roomId
|
|
||||||
} catch (throwable: Throwable) {
|
|
||||||
Timber.d(throwable, "## Failed to get roomId from alias")
|
|
||||||
null
|
|
||||||
}
|
}
|
||||||
|
}?.roomId
|
||||||
Optional.from(roomId)
|
Optional.from(roomId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,8 @@ abstract class MergedRoomCreationItem : BasedMergedItem<MergedRoomCreationItem.H
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
holder.roomTopicText.setTextOrHide(span {
|
holder.roomTopicText.setTextOrHide(
|
||||||
|
span {
|
||||||
span(holder.view.resources.getString(R.string.topic_prefix)) {
|
span(holder.view.resources.getString(R.string.topic_prefix)) {
|
||||||
textStyle = "bold"
|
textStyle = "bold"
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,7 +161,7 @@ class RoomMemberProfileController @Inject constructor(
|
||||||
} else {
|
} else {
|
||||||
genericFooterItem {
|
genericFooterItem {
|
||||||
id("verify_footer_not_encrypted")
|
id("verify_footer_not_encrypted")
|
||||||
text(stringProvider.getString(R.string.room_profile_not_encrypted_subtitle))
|
text(RRstringProvider.getString(R.string.room_profile_not_encrypted_subtitle))
|
||||||
centered(false)
|
centered(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,7 @@
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/roomNameDescriptionText"
|
app:layout_constraintTop_toBottomOf="@id/roomNameDescriptionText"
|
||||||
tools:text="Add a topic to let people know what this room is about. " />
|
tools:text="@string/room_created_summary_no_topic_creation_text" />
|
||||||
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
|
Loading…
Reference in New Issue