mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-26 12:44:38 +00:00
Move to defined from_recipient_id and to_recipient_id columns on message table.
This commit is contained in:
committed by
Cody Henthorne
parent
d079f85eca
commit
279ad7945e
@@ -143,8 +143,8 @@ object FakeMessageRecords {
|
||||
return MediaMmsMessageRecord(
|
||||
id,
|
||||
conversationRecipient,
|
||||
individualRecipient,
|
||||
recipientDeviceId,
|
||||
individualRecipient,
|
||||
dateSent,
|
||||
dateReceived,
|
||||
dateServer,
|
||||
|
||||
@@ -67,7 +67,7 @@ object TestMms {
|
||||
fun insert(
|
||||
db: SQLiteDatabase,
|
||||
message: OutgoingMessage,
|
||||
recipientId: RecipientId = message.recipient.id,
|
||||
recipientId: RecipientId = message.threadRecipient.id,
|
||||
body: String = message.body,
|
||||
type: Long = MessageTypes.BASE_INBOX_TYPE,
|
||||
unread: Boolean = false,
|
||||
@@ -86,7 +86,8 @@ object TestMms {
|
||||
put(MessageTable.SMS_SUBSCRIPTION_ID, message.subscriptionId)
|
||||
put(MessageTable.EXPIRES_IN, message.expiresIn)
|
||||
put(MessageTable.VIEW_ONCE, message.isViewOnce)
|
||||
put(MessageTable.RECIPIENT_ID, recipientId.serialize())
|
||||
put(MessageTable.FROM_RECIPIENT_ID, recipientId.serialize())
|
||||
put(MessageTable.TO_RECIPIENT_ID, recipientId.serialize())
|
||||
put(MessageTable.DELIVERY_RECEIPT_COUNT, 0)
|
||||
put(MessageTable.RECEIPT_TIMESTAMP, 0)
|
||||
put(MessageTable.VIEWED_RECEIPT_COUNT, if (viewed) 1 else 0)
|
||||
|
||||
@@ -59,8 +59,9 @@ object TestSms {
|
||||
threadId: Long = 1
|
||||
): Long {
|
||||
val values = ContentValues().apply {
|
||||
put(MessageTable.RECIPIENT_ID, message.sender.serialize())
|
||||
put(MessageTable.RECIPIENT_DEVICE_ID, message.senderDeviceId)
|
||||
put(MessageTable.FROM_RECIPIENT_ID, message.authorId.serialize())
|
||||
put(MessageTable.FROM_DEVICE_ID, message.authorDeviceId)
|
||||
put(MessageTable.TO_RECIPIENT_ID, message.authorId.serialize())
|
||||
put(MessageTable.DATE_RECEIVED, message.receivedTimestampMillis)
|
||||
put(MessageTable.DATE_SENT, message.sentTimestampMillis)
|
||||
put(MessageTable.DATE_SERVER, message.serverTimestampMillis)
|
||||
|
||||
@@ -167,8 +167,8 @@ class UploadDependencyGraphTest {
|
||||
// GIVEN
|
||||
val attachment1 = UriAttachmentBuilder.build(uniqueLong.getAndIncrement(), contentType = MediaUtil.IMAGE_JPEG)
|
||||
val attachment2 = UriAttachmentBuilder.build(uniqueLong.getAndIncrement(), contentType = MediaUtil.IMAGE_JPEG)
|
||||
val message1 = OutgoingMessage(recipient = Recipient.UNKNOWN, sentTimeMillis = System.currentTimeMillis(), attachments = listOf(attachment1))
|
||||
val message2 = OutgoingMessage(recipient = Recipient.UNKNOWN, sentTimeMillis = System.currentTimeMillis() + 1, attachments = listOf(attachment2))
|
||||
val message1 = OutgoingMessage(threadRecipient = Recipient.UNKNOWN, sentTimeMillis = System.currentTimeMillis(), attachments = listOf(attachment1))
|
||||
val message2 = OutgoingMessage(threadRecipient = Recipient.UNKNOWN, sentTimeMillis = System.currentTimeMillis() + 1, attachments = listOf(attachment2))
|
||||
val testSubject = UploadDependencyGraph.create(listOf(message1, message2), jobManager) { getAttachmentForPreUpload(uniqueLong.getAndIncrement(), it) }
|
||||
|
||||
// WHEN
|
||||
@@ -191,7 +191,7 @@ class UploadDependencyGraphTest {
|
||||
)
|
||||
}
|
||||
|
||||
val message = OutgoingMessage(recipient = Recipient.UNKNOWN, sentTimeMillis = System.currentTimeMillis(), attachments = uriAttachments)
|
||||
val message = OutgoingMessage(threadRecipient = Recipient.UNKNOWN, sentTimeMillis = System.currentTimeMillis(), attachments = uriAttachments)
|
||||
val testSubject = UploadDependencyGraph.create(listOf(message), jobManager) { getAttachmentForPreUpload(uniqueLong.getAndIncrement(), it) }
|
||||
val result = testSubject.consumeDeferredQueue()
|
||||
|
||||
@@ -262,7 +262,7 @@ class UploadDependencyGraphTest {
|
||||
private fun Iterable<Int>.createMessages(uriAttachments: List<Attachment>): List<OutgoingMessage> {
|
||||
return mapIndexed { index, _ ->
|
||||
OutgoingMessage(
|
||||
recipient = Recipient.UNKNOWN,
|
||||
threadRecipient = Recipient.UNKNOWN,
|
||||
sentTimeMillis = System.currentTimeMillis() + index,
|
||||
attachments = uriAttachments,
|
||||
isSecure = true
|
||||
|
||||
Reference in New Issue
Block a user