mirror of
https://github.com/TwidereProject/Twidere-Android
synced 2025-01-19 03:29:58 +01:00
fixed DM name first
This commit is contained in:
parent
63435c3911
commit
af1c45b4d7
@ -30,7 +30,7 @@ val ParcelableMessageConversation.timestamp: Long
|
||||
get() = if (message_timestamp > 0) message_timestamp else local_timestamp
|
||||
|
||||
fun ParcelableMessageConversation.getConversationName(context: Context,
|
||||
manager: UserColorNameManager): Pair<String, String?> {
|
||||
manager: UserColorNameManager, nameFirst: Boolean): Pair<String, String?> {
|
||||
if (conversation_type == ConversationType.ONE_TO_ONE) {
|
||||
val user = this.user ?: return Pair(context.getString(R.string.direct_messages), null)
|
||||
return Pair(user.name, user.screen_name)
|
||||
@ -38,7 +38,7 @@ fun ParcelableMessageConversation.getConversationName(context: Context,
|
||||
if (conversation_name != null) {
|
||||
return Pair(conversation_name, null)
|
||||
}
|
||||
return Pair(participants.joinToString(separator = ", ") { manager.getDisplayName(it, false) }, null)
|
||||
return Pair(participants.joinToString(separator = ", ") { manager.getDisplayName(it, nameFirst) }, null)
|
||||
}
|
||||
|
||||
fun ParcelableMessageConversation.getSummaryText(context: Context, manager: UserColorNameManager,
|
||||
|
@ -55,7 +55,7 @@ class MessageEntryViewHolder(itemView: View, val adapter: MessagesEntriesAdapter
|
||||
content.drawEnd()
|
||||
}
|
||||
val (name, secondaryName) = conversation.getConversationName(itemView.context,
|
||||
adapter.userColorNameManager)
|
||||
adapter.userColorNameManager, adapter.nameFirst)
|
||||
this.time.time = conversation.timestamp
|
||||
this.name.name = name
|
||||
this.name.screenName = secondaryName
|
||||
|
Loading…
Reference in New Issue
Block a user