mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
[android] Create attachments before showing previews
This commit is contained in:
@@ -25,4 +25,15 @@ public class AttachmentHeader {
|
||||
return contentType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof AttachmentHeader &&
|
||||
messageId.equals(((AttachmentHeader) o).messageId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return messageId.hashCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,4 +8,19 @@ public interface MessagingConstants {
|
||||
* The maximum length of a private message's text in UTF-8 bytes.
|
||||
*/
|
||||
int MAX_PRIVATE_MESSAGE_TEXT_LENGTH = MAX_MESSAGE_BODY_LENGTH - 1024;
|
||||
|
||||
/**
|
||||
* The supported mime types for image attachments.
|
||||
*/
|
||||
String[] IMAGE_MIME_TYPES = {
|
||||
"image/jpeg",
|
||||
"image/png",
|
||||
"image/gif",
|
||||
};
|
||||
|
||||
/**
|
||||
* The maximum allowed size of image attachments.
|
||||
*/
|
||||
int MAX_IMAGE_SIZE = 6 * 1024 * 1024;
|
||||
|
||||
}
|
||||
|
||||
@@ -41,6 +41,11 @@ public interface MessagingManager extends ConversationClient {
|
||||
AttachmentHeader addLocalAttachment(GroupId groupId, long timestamp,
|
||||
String contentType, InputStream is) throws DbException, IOException;
|
||||
|
||||
/**
|
||||
* Removes an unsent attachment.
|
||||
*/
|
||||
void removeAttachment(AttachmentHeader header) throws DbException;
|
||||
|
||||
/**
|
||||
* Returns the ID of the contact with the given private conversation.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user