mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 11:49:04 +01:00
Remove content-type and parentId from private messages
and turn them into a regular string.
This commit is contained in:
@@ -30,6 +30,6 @@ public interface MessagingManager extends MessageTracker {
|
||||
throws DbException;
|
||||
|
||||
/** Returns the body of the private message with the given ID. */
|
||||
byte[] getMessageBody(MessageId m) throws DbException;
|
||||
String getMessageBody(MessageId m) throws DbException;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,23 +1,22 @@
|
||||
package org.briarproject.api.messaging;
|
||||
|
||||
import org.briarproject.api.clients.BaseMessage;
|
||||
import org.briarproject.api.nullsafety.NotNullByDefault;
|
||||
import org.briarproject.api.sync.Message;
|
||||
import org.briarproject.api.sync.MessageId;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class PrivateMessage extends BaseMessage {
|
||||
import javax.annotation.concurrent.Immutable;
|
||||
|
||||
private final String contentType;
|
||||
@Immutable
|
||||
@NotNullByDefault
|
||||
public class PrivateMessage {
|
||||
|
||||
public PrivateMessage(@NotNull Message message, @Nullable MessageId parent,
|
||||
@NotNull String contentType) {
|
||||
super(message, parent);
|
||||
this.contentType = contentType;
|
||||
private final Message message;
|
||||
|
||||
public PrivateMessage(Message message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getContentType() {
|
||||
return contentType;
|
||||
public Message getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package org.briarproject.api.messaging;
|
||||
|
||||
import org.briarproject.api.FormatException;
|
||||
import org.briarproject.api.nullsafety.NotNullByDefault;
|
||||
import org.briarproject.api.sync.GroupId;
|
||||
import org.briarproject.api.sync.MessageId;
|
||||
|
||||
@NotNullByDefault
|
||||
public interface PrivateMessageFactory {
|
||||
|
||||
PrivateMessage createPrivateMessage(GroupId groupId, long timestamp,
|
||||
MessageId parent, String contentType, byte[] body)
|
||||
throws FormatException;
|
||||
String body) throws FormatException;
|
||||
|
||||
}
|
||||
|
||||
@@ -6,17 +6,10 @@ import org.briarproject.api.sync.MessageId;
|
||||
|
||||
public class PrivateMessageHeader extends BaseMessageHeader {
|
||||
|
||||
private final String contentType;
|
||||
|
||||
public PrivateMessageHeader(MessageId id, GroupId groupId, long timestamp,
|
||||
String contentType, boolean local, boolean read, boolean sent,
|
||||
boolean seen) {
|
||||
boolean local, boolean read, boolean sent, boolean seen) {
|
||||
|
||||
super(id, groupId, timestamp, local, read, sent, seen);
|
||||
this.contentType = contentType;
|
||||
}
|
||||
|
||||
public String getContentType() {
|
||||
return contentType;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user