Room details: Check power level before showing topic hint

This commit is contained in:
Florian Renaud 2021-09-06 15:58:18 +02:00
parent e1f7ab8669
commit 24e2f1a8e0

View file

@ -143,7 +143,8 @@ abstract class MergedRoomCreationItem : BasedMergedItem<MergedRoomCreationItem.H
val topic = roomSummary?.topic
if (topic.isNullOrBlank()) {
// do not show hint for DMs or group DMs
if (!isDirect) {
val canSetTopic = attributes.canChangeTopic && !isDirect
if (canSetTopic) {
val addTopicLink = holder.view.resources.getString(R.string.add_a_topic_link_text)
val styledText = SpannableString(holder.view.resources.getString(R.string.room_created_summary_no_topic_creation_text, addTopicLink))
holder.roomTopicText.setTextOrHide(styledText.tappableMatchingText(addTopicLink, object : ClickableSpan() {