#45 - Rename group chats

This commit is contained in:
Moez Bhatti
2018-06-09 01:23:22 -04:00
parent d4093cc8ff
commit bd6c5ca5e5
13 changed files with 140 additions and 12 deletions
+6 -1
View File
@@ -36,5 +36,10 @@ open class Conversation : RealmObject() {
var me: Boolean = false
var draft: String = ""
fun getTitle() = recipients.joinToString { recipient -> recipient.getDisplayName() }
// For group chats, the user is allowed to set a custom title for the conversation
var name: String = ""
fun getTitle(): String {
return name.takeIf { it.isNotBlank() } ?: recipients.joinToString { recipient -> recipient.getDisplayName() }
}
}
@@ -31,6 +31,8 @@ interface MessageRepository {
fun getConversationsSnapshot(): List<Conversation>
fun setConversationName(id: Long, name: String)
fun searchConversations(query: String): List<SearchResult>
fun getBlockedConversations(): RealmResults<Conversation>