Add ability to rename group conversations
This commit is contained in:
parent
75bbd5ea0e
commit
8d283858e1
10 changed files with 201 additions and 19 deletions
|
|
@ -257,9 +257,14 @@ class MainActivity : SimpleActivity() {
|
|||
}
|
||||
|
||||
cachedConversations.forEach { cachedConv ->
|
||||
val conv = conversations.find { it.threadId == cachedConv.threadId && !Conversation.areContentsTheSame(cachedConv, it) }
|
||||
val conv = conversations.find {
|
||||
it.threadId == cachedConv.threadId && !Conversation.areContentsTheSame(cachedConv, it)
|
||||
}
|
||||
if (conv != null) {
|
||||
val conversation = conv.copy(date = maxOf(cachedConv.date, conv.date))
|
||||
val lastModified = maxOf(cachedConv.date, conv.date)
|
||||
val usesCustomTitle = cachedConv.usesCustomTitle
|
||||
val title = if (usesCustomTitle) cachedConv.title else conv.title
|
||||
val conversation = conv.copy(date = lastModified, title = title, usesCustomTitle = usesCustomTitle)
|
||||
conversationsDB.insertOrUpdate(conversation)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue