[core] Add API to add messages with attachments

This commit is contained in:
Torsten Grote
2018-11-05 10:32:38 -03:00
parent 483106e00c
commit cccaeeda6c
10 changed files with 37 additions and 8 deletions

View File

@@ -8,6 +8,8 @@ import org.briarproject.bramble.api.sync.GroupId;
import org.briarproject.bramble.api.sync.MessageId;
import org.briarproject.briar.api.conversation.ConversationManager.ConversationClient;
import java.nio.ByteBuffer;
@NotNullByDefault
public interface MessagingManager extends ConversationClient {
@@ -31,6 +33,12 @@ public interface MessagingManager extends ConversationClient {
*/
void addLocalMessage(PrivateMessage m) throws DbException;
/**
* Stores a local attachment message.
*/
AttachmentHeader addLocalAttachment(GroupId groupId, long timestamp,
String contentType, ByteBuffer data) throws DbException;
/**
* Returns the ID of the contact with the given private conversation.
*/

View File

@@ -4,10 +4,13 @@ import org.briarproject.bramble.api.FormatException;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.sync.GroupId;
import java.util.List;
@NotNullByDefault
public interface PrivateMessageFactory {
PrivateMessage createPrivateMessage(GroupId groupId, long timestamp,
String text) throws FormatException;
String text, List<AttachmentHeader> attachments)
throws FormatException;
}