add new contact database api

This commit is contained in:
Ryan ZHAO
2021-05-07 16:31:46 +10:00
parent cbd6ae3bcb
commit a16e67d1fd
7 changed files with 138 additions and 8 deletions

View File

@@ -3,6 +3,7 @@ package org.session.libsession.messaging
import android.content.Context
import android.net.Uri
import org.session.libsession.messaging.contacts.Contact
import org.session.libsession.messaging.jobs.AttachmentUploadJob
import org.session.libsession.messaging.jobs.Job
import org.session.libsession.messaging.jobs.MessageSendJob
@@ -146,9 +147,12 @@ interface StorageProtocol {
fun getSessionRequestProcessedTimestamp(publicKey: String): Long?
fun setSessionRequestProcessedTimestamp(publicKey: String, newValue: Long)
// Loki User
// Session Contact (Loki User)
fun getDisplayName(publicKey: String): String?
fun getProfilePictureURL(publicKey: String): String?
fun getContactWithSessionID(sessionID: String): Contact?
fun getAllContacts(): Set<Contact>
fun setContact(contact: Contact)
// Recipient
fun getRecipientSettings(address: Address): RecipientSettings?

View File

@@ -10,7 +10,7 @@ class Contact(val sessionID: String) {
// The key with which the profile picture is encrypted.
var profilePictureEncryptionKey: ByteArray? = null
// The ID of the thread associated with this contact.
var threadID: String? = null
var threadID: Int? = null
// This flag is used to determine whether we should auto-download files sent by this contact.
var isTrusted = false