diff --git a/app/src/main/java/com/nextcloud/talk/adapters/items/ParticipantItem.kt b/app/src/main/java/com/nextcloud/talk/adapters/items/ParticipantItem.kt index 9126cd6b3..bfe4d801f 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/items/ParticipantItem.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/items/ParticipantItem.kt @@ -26,11 +26,13 @@ import com.nextcloud.talk.extensions.loadFederatedUserAvatar import com.nextcloud.talk.extensions.loadGuestAvatar import com.nextcloud.talk.extensions.loadMailAvatar import com.nextcloud.talk.extensions.loadUserAvatar +import com.nextcloud.talk.models.domain.ConversationModel import com.nextcloud.talk.models.json.participants.Participant import com.nextcloud.talk.models.json.participants.Participant.InCallFlags import com.nextcloud.talk.models.json.status.StatusType import com.nextcloud.talk.ui.StatusDrawable import com.nextcloud.talk.ui.theme.ViewThemeUtils +import com.nextcloud.talk.utils.ConversationUtils import com.nextcloud.talk.utils.DisplayUtils import com.nextcloud.talk.utils.DisplayUtils.convertDpToPixel import eu.davidea.flexibleadapter.FlexibleAdapter @@ -45,7 +47,7 @@ class ParticipantItem( val model: Participant, private val user: User, private val viewThemeUtils: ViewThemeUtils, - private val roomToken: String + private val conversation: ConversationModel ) : AbstractFlexibleItem(), IFilterable { var isOnline = true override fun equals(o: Any?): Boolean { @@ -128,7 +130,13 @@ class ParticipantItem( Participant.ParticipantType.GUEST -> { userType = sharedApplication!!.getString(R.string.nc_guest) if (model.calculatedActorType == Participant.ActorType.EMAILS) { - userType = sharedApplication!!.getString(R.string.nc_email) + userType = sharedApplication!!.getString(R.string.nc_guest) + } + + if (model.invitedActorId?.isNotEmpty() == true && + ConversationUtils.isParticipantOwnerOrModerator(conversation)) { + holder.binding.conversationInfoStatusMessage.text = model.invitedActorId + alignUsernameVertical(holder, 0f) } } @@ -218,7 +226,7 @@ class ParticipantItem( holder.binding.avatarView.loadFederatedUserAvatar( user, user.baseUrl!!, - roomToken, + conversation.token, model.actorId!!, darkTheme, true, diff --git a/app/src/main/java/com/nextcloud/talk/conversationinfo/ConversationInfoActivity.kt b/app/src/main/java/com/nextcloud/talk/conversationinfo/ConversationInfoActivity.kt index b491094ab..d6f72f3cb 100644 --- a/app/src/main/java/com/nextcloud/talk/conversationinfo/ConversationInfoActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/conversationinfo/ConversationInfoActivity.kt @@ -568,7 +568,7 @@ class ConversationInfoActivity : for (i in participants.indices) { participant = participants[i] - userItem = ParticipantItem(this, participant, conversationUser, viewThemeUtils, conversationToken) + userItem = ParticipantItem(this, participant, conversationUser, viewThemeUtils, conversation!!) if (participant.sessionId != null) { userItem.isOnline = !participant.sessionId.equals("0") } else { diff --git a/app/src/main/java/com/nextcloud/talk/models/json/participants/Participant.kt b/app/src/main/java/com/nextcloud/talk/models/json/participants/Participant.kt index 11b92d61e..ae8b374c9 100644 --- a/app/src/main/java/com/nextcloud/talk/models/json/participants/Participant.kt +++ b/app/src/main/java/com/nextcloud/talk/models/json/participants/Participant.kt @@ -72,6 +72,9 @@ data class Participant( @JsonField(name = ["statusMessage"]) var statusMessage: String? = null, + @JsonField(name = ["invitedActorId"]) + var invitedActorId: String? = null, + var selected: Boolean = false ) : Parcelable { // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' diff --git a/app/src/main/res/layout/rv_item_conversation_info_participant.xml b/app/src/main/res/layout/rv_item_conversation_info_participant.xml index a72288131..94520135e 100644 --- a/app/src/main/res/layout/rv_item_conversation_info_participant.xml +++ b/app/src/main/res/layout/rv_item_conversation_info_participant.xml @@ -66,7 +66,6 @@ android:ellipsize="end" android:maxLines="3" android:textAlignment="viewStart" - android:textAppearance="?android:attr/textAppearanceListItem" android:textColor="?android:attr/textColorSecondary" android:layout_marginEnd="@dimen/side_margin" app:layout_constraintBottom_toBottomOf="parent"