1
0
mirror of https://github.com/TwidereProject/Twidere-Android synced 2025-01-19 11:39:52 +01:00

fixed DM name first

This commit is contained in:
Mariotaku Lee 2017-02-14 20:33:12 +08:00
parent 63435c3911
commit af1c45b4d7
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535
2 changed files with 3 additions and 3 deletions

View File

@ -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,

View File

@ -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