mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 03:39:05 +01:00
Throw an exception if a raw message has been deleted.
This commit is contained in:
@@ -94,7 +94,7 @@ class BlogManagerImpl extends BdfIncomingMessageHook implements BlogManager,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addingContact(Transaction txn, Contact c) throws DbException {
|
||||
public void addingContact(Transaction txn, Contact c) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -311,7 +311,6 @@ class BlogManagerImpl extends BdfIncomingMessageHook implements BlogManager,
|
||||
|
||||
// Get body of message to be wrapped
|
||||
BdfList body = clientHelper.getMessageAsList(txn, header.getId());
|
||||
if (body == null) throw new DbException();
|
||||
long timestamp = header.getTimestamp();
|
||||
Message wrappedMessage;
|
||||
|
||||
@@ -459,9 +458,7 @@ class BlogManagerImpl extends BdfIncomingMessageHook implements BlogManager,
|
||||
@Override
|
||||
public String getPostBody(MessageId m) throws DbException {
|
||||
try {
|
||||
BdfList message = clientHelper.getMessageAsList(m);
|
||||
if (message == null) throw new DbException();
|
||||
return getPostBody(message);
|
||||
return getPostBody(clientHelper.getMessageAsList(m));
|
||||
} catch (FormatException e) {
|
||||
throw new DbException(e);
|
||||
}
|
||||
|
||||
@@ -204,10 +204,7 @@ class ForumManagerImpl extends BdfIncomingMessageHook implements ForumManager {
|
||||
@Override
|
||||
public String getPostBody(MessageId m) throws DbException {
|
||||
try {
|
||||
// Parent ID, author, forum post body, signature
|
||||
BdfList body = clientHelper.getMessageAsList(m);
|
||||
if (body == null) throw new DbException();
|
||||
return getPostBody(body);
|
||||
return getPostBody(clientHelper.getMessageAsList(m));
|
||||
} catch (FormatException e) {
|
||||
throw new DbException(e);
|
||||
}
|
||||
|
||||
@@ -463,7 +463,6 @@ class IntroductionManagerImpl extends ConversationClientImpl
|
||||
author = session.getRemote().author;
|
||||
} else throw new AssertionError();
|
||||
Message msg = clientHelper.getMessage(txn, m);
|
||||
if (msg == null) throw new AssertionError();
|
||||
BdfList body = clientHelper.toList(msg);
|
||||
RequestMessage rm = messageParser.parseRequestMessage(msg, body);
|
||||
String message = rm.getMessage();
|
||||
|
||||
@@ -217,9 +217,7 @@ class MessagingManagerImpl extends ConversationClientImpl
|
||||
public String getMessageBody(MessageId m) throws DbException {
|
||||
try {
|
||||
// 0: private message body
|
||||
BdfList message = clientHelper.getMessageAsList(m);
|
||||
if (message == null) throw new DbException();
|
||||
return message.getString(0);
|
||||
return clientHelper.getMessageAsList(m).getString(0);
|
||||
} catch (FormatException e) {
|
||||
throw new DbException(e);
|
||||
}
|
||||
|
||||
@@ -301,9 +301,7 @@ class PrivateGroupManagerImpl extends BdfIncomingMessageHook
|
||||
@Override
|
||||
public String getMessageBody(MessageId m) throws DbException {
|
||||
try {
|
||||
BdfList body = clientHelper.getMessageAsList(m);
|
||||
if (body == null) throw new DbException();
|
||||
return getMessageBody(body);
|
||||
return getMessageBody(clientHelper.getMessageAsList(m));
|
||||
} catch (FormatException e) {
|
||||
throw new DbException(e);
|
||||
}
|
||||
|
||||
@@ -91,7 +91,6 @@ class MessageParserImpl implements MessageParser {
|
||||
public InviteMessage getInviteMessage(Transaction txn, MessageId m)
|
||||
throws DbException, FormatException {
|
||||
Message message = clientHelper.getMessage(txn, m);
|
||||
if (message == null) throw new DbException();
|
||||
BdfList body = clientHelper.toList(message);
|
||||
return parseInviteMessage(message, body);
|
||||
}
|
||||
|
||||
@@ -78,7 +78,6 @@ abstract class MessageParserImpl<S extends Shareable>
|
||||
public InviteMessage<S> getInviteMessage(Transaction txn, MessageId m)
|
||||
throws DbException, FormatException {
|
||||
Message message = clientHelper.getMessage(txn, m);
|
||||
if (message == null) throw new DbException();
|
||||
BdfList body = clientHelper.toList(message);
|
||||
return parseInviteMessage(message, body);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user