Show the follower's bio/note in a "followed you" notification (#3281)

This makes the notification view for a follow request contain more info about the new follower, and makes the layout (of their name / username) consistent with other notifications that show names/usernames.
This commit is contained in:
Nik Clayton 2023-04-24 12:09:34 +02:00 committed by GitHub
commit f1b3faf85f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 35 additions and 7 deletions

View file

@ -64,6 +64,7 @@ data class ConversationAccountEntity(
localUsername = localUsername,
username = username,
displayName = displayName,
note = "",
url = "",
avatar = avatar,
emojis = emojis

View file

@ -25,6 +25,7 @@ import com.keylesspalace.tusky.entity.TimelineAccount
import com.keylesspalace.tusky.util.StatusDisplayOptions
import com.keylesspalace.tusky.util.emojify
import com.keylesspalace.tusky.util.loadAvatar
import com.keylesspalace.tusky.util.parseAsMastodonHtml
import com.keylesspalace.tusky.util.unicodeWrap
import com.keylesspalace.tusky.viewdata.NotificationViewData
@ -92,6 +93,12 @@ class FollowViewHolder(
avatarRadius42dp,
animateAvatars
)
binding.notificationAccountNote.text = account.note.parseAsMastodonHtml().emojify(
account.emojis,
binding.notificationAccountNote,
animateEmojis
)
}
private fun setupButtons(listener: NotificationActionListener, accountId: String) {

View file

@ -63,6 +63,7 @@ fun TimelineAccountEntity.toAccount(gson: Gson): TimelineAccount {
localUsername = localUsername,
username = username,
displayName = displayName,
note = "",
url = url,
avatar = avatar,
bot = bot,

View file

@ -28,6 +28,7 @@ data class TimelineAccount(
@SerializedName("display_name") val displayName: String?, // should never be null per Api definition, but some servers break the contract
val url: String,
val avatar: String,
val note: String,
val bot: Boolean = false,
val emojis: List<Emoji>? = emptyList() // nullable for backward compatibility
) {