display email address of guest users for moderators

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2024-11-19 13:55:28 +01:00
parent 47004b8f4b
commit 6e3188f1df
No known key found for this signature in database
GPG key ID: C793F8B59F43CE7B
4 changed files with 15 additions and 5 deletions

View file

@ -26,11 +26,13 @@ import com.nextcloud.talk.extensions.loadFederatedUserAvatar
import com.nextcloud.talk.extensions.loadGuestAvatar import com.nextcloud.talk.extensions.loadGuestAvatar
import com.nextcloud.talk.extensions.loadMailAvatar import com.nextcloud.talk.extensions.loadMailAvatar
import com.nextcloud.talk.extensions.loadUserAvatar 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
import com.nextcloud.talk.models.json.participants.Participant.InCallFlags import com.nextcloud.talk.models.json.participants.Participant.InCallFlags
import com.nextcloud.talk.models.json.status.StatusType import com.nextcloud.talk.models.json.status.StatusType
import com.nextcloud.talk.ui.StatusDrawable import com.nextcloud.talk.ui.StatusDrawable
import com.nextcloud.talk.ui.theme.ViewThemeUtils 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
import com.nextcloud.talk.utils.DisplayUtils.convertDpToPixel import com.nextcloud.talk.utils.DisplayUtils.convertDpToPixel
import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.FlexibleAdapter
@ -45,7 +47,7 @@ class ParticipantItem(
val model: Participant, val model: Participant,
private val user: User, private val user: User,
private val viewThemeUtils: ViewThemeUtils, private val viewThemeUtils: ViewThemeUtils,
private val roomToken: String private val conversation: ConversationModel
) : AbstractFlexibleItem<ParticipantItemViewHolder>(), IFilterable<String?> { ) : AbstractFlexibleItem<ParticipantItemViewHolder>(), IFilterable<String?> {
var isOnline = true var isOnline = true
override fun equals(o: Any?): Boolean { override fun equals(o: Any?): Boolean {
@ -128,7 +130,13 @@ class ParticipantItem(
Participant.ParticipantType.GUEST -> { Participant.ParticipantType.GUEST -> {
userType = sharedApplication!!.getString(R.string.nc_guest) userType = sharedApplication!!.getString(R.string.nc_guest)
if (model.calculatedActorType == Participant.ActorType.EMAILS) { 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( holder.binding.avatarView.loadFederatedUserAvatar(
user, user,
user.baseUrl!!, user.baseUrl!!,
roomToken, conversation.token,
model.actorId!!, model.actorId!!,
darkTheme, darkTheme,
true, true,

View file

@ -568,7 +568,7 @@ class ConversationInfoActivity :
for (i in participants.indices) { for (i in participants.indices) {
participant = participants[i] participant = participants[i]
userItem = ParticipantItem(this, participant, conversationUser, viewThemeUtils, conversationToken) userItem = ParticipantItem(this, participant, conversationUser, viewThemeUtils, conversation!!)
if (participant.sessionId != null) { if (participant.sessionId != null) {
userItem.isOnline = !participant.sessionId.equals("0") userItem.isOnline = !participant.sessionId.equals("0")
} else { } else {

View file

@ -72,6 +72,9 @@ data class Participant(
@JsonField(name = ["statusMessage"]) @JsonField(name = ["statusMessage"])
var statusMessage: String? = null, var statusMessage: String? = null,
@JsonField(name = ["invitedActorId"])
var invitedActorId: String? = null,
var selected: Boolean = false var selected: Boolean = false
) : Parcelable { ) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'

View file

@ -66,7 +66,6 @@
android:ellipsize="end" android:ellipsize="end"
android:maxLines="3" android:maxLines="3"
android:textAlignment="viewStart" android:textAlignment="viewStart"
android:textAppearance="?android:attr/textAppearanceListItem"
android:textColor="?android:attr/textColorSecondary" android:textColor="?android:attr/textColorSecondary"
android:layout_marginEnd="@dimen/side_margin" android:layout_marginEnd="@dimen/side_margin"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"