Add ability to rename group conversations
This commit is contained in:
parent
75bbd5ea0e
commit
8d283858e1
10 changed files with 201 additions and 19 deletions
|
|
@ -1023,6 +1023,20 @@ fun Context.subscriptionManagerCompat(): SubscriptionManager {
|
|||
}
|
||||
}
|
||||
|
||||
fun Context.renameConversation(conversation: Conversation, newTitle: String): Conversation {
|
||||
require(conversation.isGroupConversation) {
|
||||
"Can only rename group conversations."
|
||||
}
|
||||
|
||||
val updatedConv = conversation.copy(title = newTitle, usesCustomTitle = true)
|
||||
try {
|
||||
conversationsDB.insertOrUpdate(updatedConv)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
return updatedConv
|
||||
}
|
||||
|
||||
fun Context.createTemporaryThread(message: Message, threadId: Long = generateRandomId()) {
|
||||
val simpleContactHelper = SimpleContactsHelper(this)
|
||||
val addresses = message.participants.getAddresses()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue