This commit is contained in:
Sowjanya Kota 2025-06-18 09:50:28 +02:00 committed by GitHub
commit 42980a3a52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 20 additions and 2 deletions

View File

@ -25,6 +25,7 @@ import com.nextcloud.talk.extensions.loadDefaultAvatar
import com.nextcloud.talk.extensions.loadDefaultGroupCallAvatar
import com.nextcloud.talk.extensions.loadFederatedUserAvatar
import com.nextcloud.talk.extensions.loadFirstLetterAvatar
import com.nextcloud.talk.extensions.loadPhoneAvatar
import com.nextcloud.talk.extensions.loadTeamAvatar
import com.nextcloud.talk.extensions.loadUserAvatar
import com.nextcloud.talk.models.domain.ConversationModel
@ -242,6 +243,10 @@ class ParticipantItem(
)
}
Participant.ActorType.PHONES -> {
holder.binding.avatarView.loadPhoneAvatar(viewThemeUtils)
}
else -> {
Log.w(TAG, "Avatar not shown because of unknown ActorType " + model.calculatedActorType)
}

View File

@ -422,7 +422,8 @@ data class ChatMessage(
AVATAR_SET,
AVATAR_REMOVED,
FEDERATED_USER_ADDED,
FEDERATED_USER_REMOVED
FEDERATED_USER_REMOVED,
PHONE_ADDED
}
companion object {

View File

@ -206,6 +206,11 @@ fun ImageView.loadAvatarWithUrl(user: User? = null, url: String): io.reactivex.d
return loadAvatarInternal(user, url, false, null)
}
fun ImageView.loadPhoneAvatar(viewThemeUtils: ViewThemeUtils): io.reactivex.disposables.Disposable {
val drawable = viewThemeUtils.talk.themePlaceholderAvatar(this, R.drawable.ic_phone)
return loadUserAvatar(drawable)
}
fun ImageView.loadThumbnail(url: String, user: User): io.reactivex.disposables.Disposable {
val requestBuilder = ImageRequest.Builder(context)
.data(url)

View File

@ -16,6 +16,7 @@ import com.nextcloud.talk.models.json.participants.Participant.ActorType.FEDERAT
import com.nextcloud.talk.models.json.participants.Participant.ActorType.GROUPS
import com.nextcloud.talk.models.json.participants.Participant.ActorType.GUESTS
import com.nextcloud.talk.models.json.participants.Participant.ActorType.USERS
import com.nextcloud.talk.models.json.participants.Participant.ActorType.PHONES
class EnumActorTypeConverter : StringBasedTypeConverter<Participant.ActorType>() {
override fun getFromString(string: String?): Participant.ActorType {
@ -26,6 +27,7 @@ class EnumActorTypeConverter : StringBasedTypeConverter<Participant.ActorType>()
"users" -> USERS
"circles" -> CIRCLES
"federated_users" -> FEDERATED
"phones" -> PHONES
else -> DUMMY
}
}
@ -42,6 +44,7 @@ class EnumActorTypeConverter : StringBasedTypeConverter<Participant.ActorType>()
USERS -> "users"
CIRCLES -> "circles"
FEDERATED -> "federated_users"
PHONES -> "phones"
else -> ""
}
}

View File

@ -71,6 +71,7 @@ import com.nextcloud.talk.chat.data.model.ChatMessage.SystemMessageType.RECORDIN
import com.nextcloud.talk.chat.data.model.ChatMessage.SystemMessageType.RECORDING_STOPPED
import com.nextcloud.talk.chat.data.model.ChatMessage.SystemMessageType.USER_ADDED
import com.nextcloud.talk.chat.data.model.ChatMessage.SystemMessageType.USER_REMOVED
import com.nextcloud.talk.chat.data.model.ChatMessage.SystemMessageType.PHONE_ADDED
/*
* see https://nextcloud-talk.readthedocs.io/en/latest/chat/#system-messages
@ -141,6 +142,7 @@ class EnumSystemMessageTypeConverter : StringBasedTypeConverter<ChatMessage.Syst
"avatar_removed" -> AVATAR_REMOVED
"federated_user_added" -> FEDERATED_USER_ADDED
"federated_user_removed" -> FEDERATED_USER_REMOVED
"phone_added" -> PHONE_ADDED
else -> DUMMY
}
}
@ -210,6 +212,7 @@ class EnumSystemMessageTypeConverter : StringBasedTypeConverter<ChatMessage.Syst
AVATAR_REMOVED -> "avatar_removed"
FEDERATED_USER_ADDED -> "federated_user_added"
FEDERATED_USER_REMOVED -> "federated_user_removed"
PHONE_ADDED -> "phone_added"
else -> ""
}
}

View File

@ -117,7 +117,8 @@ data class Participant(
GUESTS,
USERS,
CIRCLES,
FEDERATED
FEDERATED,
PHONES
}
enum class ParticipantType {