mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-18 19:19:33 +01:00
Merge ef71e5f04e
into 2a7359c1e9
This commit is contained in:
commit
42980a3a52
@ -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)
|
||||
}
|
||||
|
@ -422,7 +422,8 @@ data class ChatMessage(
|
||||
AVATAR_SET,
|
||||
AVATAR_REMOVED,
|
||||
FEDERATED_USER_ADDED,
|
||||
FEDERATED_USER_REMOVED
|
||||
FEDERATED_USER_REMOVED,
|
||||
PHONE_ADDED
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
@ -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)
|
||||
|
@ -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 -> ""
|
||||
}
|
||||
}
|
||||
|
@ -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 -> ""
|
||||
}
|
||||
}
|
||||
|
@ -117,7 +117,8 @@ data class Participant(
|
||||
GUESTS,
|
||||
USERS,
|
||||
CIRCLES,
|
||||
FEDERATED
|
||||
FEDERATED,
|
||||
PHONES
|
||||
}
|
||||
|
||||
enum class ParticipantType {
|
||||
|
Loading…
Reference in New Issue
Block a user