mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 19:59:05 +01:00
[core] Add API to add messages with attachments
This commit is contained in:
@@ -24,6 +24,7 @@ import org.junit.Test;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import static java.util.Collections.emptyList;
|
||||
import static org.briarproject.bramble.api.identity.AuthorConstants.MAX_AUTHOR_NAME_LENGTH;
|
||||
import static org.briarproject.bramble.api.identity.AuthorConstants.MAX_PUBLIC_KEY_LENGTH;
|
||||
import static org.briarproject.bramble.api.record.Record.MAX_RECORD_PAYLOAD_BYTES;
|
||||
@@ -58,7 +59,7 @@ public class MessageSizeIntegrationTest extends BriarTestCase {
|
||||
long timestamp = Long.MAX_VALUE;
|
||||
String text = getRandomString(MAX_PRIVATE_MESSAGE_TEXT_LENGTH);
|
||||
PrivateMessage message = privateMessageFactory.createPrivateMessage(
|
||||
groupId, timestamp, text);
|
||||
groupId, timestamp, text, emptyList());
|
||||
// Check the size of the serialised message
|
||||
int length = message.getMessage().getRawLength();
|
||||
assertTrue(length > UniqueId.LENGTH + 8
|
||||
|
||||
@@ -41,6 +41,7 @@ import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
|
||||
import static java.util.Collections.emptyList;
|
||||
import static org.briarproject.bramble.api.transport.TransportConstants.TAG_LENGTH;
|
||||
import static org.briarproject.bramble.test.TestPluginConfigModule.MAX_LATENCY;
|
||||
import static org.briarproject.bramble.test.TestPluginConfigModule.TRANSPORT_ID;
|
||||
@@ -121,7 +122,7 @@ public class SimplexMessagingIntegrationTest extends BriarTestCase {
|
||||
PrivateMessageFactory privateMessageFactory =
|
||||
device.getPrivateMessageFactory();
|
||||
PrivateMessage message = privateMessageFactory.createPrivateMessage(
|
||||
groupId, System.currentTimeMillis(), "Hi!");
|
||||
groupId, System.currentTimeMillis(), "Hi!", emptyList());
|
||||
messagingManager.addLocalMessage(message);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user