Add ability to rename group conversations

This commit is contained in:
Naveen 2022-11-21 02:51:51 +05:30
parent 75bbd5ea0e
commit 8d283858e1
10 changed files with 201 additions and 19 deletions

View file

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