attachmentId type changed to Long

This commit is contained in:
Brice
2020-12-15 15:45:44 +11:00
parent 73c4e44711
commit 625e9f172a
7 changed files with 40 additions and 13 deletions

View File

@@ -1,9 +1,18 @@
package org.session.libsession.database
import org.session.libsession.database.dto.AttachmentState
import org.session.libsession.database.dto.DatabaseAttachmentDTO
import org.session.libsession.messaging.messages.visible.Attachment
interface MessageDataProvider {
fun getAttachment(uniqueID: String): DatabaseAttachmentDTO?
fun getAttachment(attachmentId: Long): DatabaseAttachmentDTO?
fun setAttachmentState(attachmentState: AttachmentState, attachment: DatabaseAttachmentDTO, messageID: Long)
fun isOutgoingMessage(timestamp: Long): Boolean
@Throws(Exception::class)
fun uploadAttachment(attachmentId: Long)
}

View File

@@ -6,6 +6,8 @@ import org.session.libsignal.service.internal.push.SignalServiceProtos
import kotlin.math.round
class DatabaseAttachmentDTO {
var attachmentId: Long = 0
var contentType: String? = null
var fileName: String? = null

View File

@@ -35,7 +35,7 @@ interface StorageProtocol {
fun markJobAsSucceeded(job: Job)
fun markJobAsFailed(job: Job)
fun getAllPendingJobs(type: String): List<Job>
fun getAttachmentUploadJob(attachmentID: String): AttachmentUploadJob?
fun getAttachmentUploadJob(attachmentID: Long): AttachmentUploadJob?
fun getMessageSendJob(messageSendJobID: String): MessageSendJob?
fun resumeMessageSendJobIfNeeded(messageSendJobID: String)
fun isJobCanceled(job: Job): Boolean

View File

@@ -8,7 +8,7 @@ class LinkPreview() {
var title: String? = null
var url: String? = null
var attachmentID: String? = null
var attachmentID: Long? = 0
companion object {
const val TAG = "LinkPreview"
@@ -21,7 +21,7 @@ class LinkPreview() {
}
//constructor
internal constructor(title: String?, url: String, attachmentID: String?) : this() {
internal constructor(title: String?, url: String, attachmentID: Long?) : this() {
this.title = title
this.url = url
this.attachmentID = attachmentID

View File

@@ -11,7 +11,7 @@ class Quote() {
var timestamp: Long? = 0
var publicKey: String? = null
var text: String? = null
var attachmentID: String? = null
var attachmentID: Long? = null
companion object {
const val TAG = "Quote"
@@ -25,7 +25,7 @@ class Quote() {
}
//constructor
internal constructor(timestamp: Long, publicKey: String, text: String?, attachmentID: String?) : this() {
internal constructor(timestamp: Long, publicKey: String, text: String?, attachmentID: Long?) : this() {
this.timestamp = timestamp
this.publicKey = publicKey
this.text = text

View File

@@ -11,7 +11,7 @@ import org.session.libsignal.service.internal.push.SignalServiceProtos
class VisibleMessage : Message() {
var text: String? = null
var attachmentIDs = ArrayList<String>()
var attachmentIDs = ArrayList<Long>()
var quote: Quote? = null
var linkPreview: LinkPreview? = null
var contact: Contact? = null