mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 05:39:53 +01:00
Don't throw an exception if the client has no delivery hook.
This commit is contained in:
@@ -339,9 +339,9 @@ class ValidationManagerImpl implements ValidationManager, Service,
|
|||||||
|
|
||||||
private boolean deliverMessage(Transaction txn, Message m, ClientId c,
|
private boolean deliverMessage(Transaction txn, Message m, ClientId c,
|
||||||
Metadata meta) throws DbException {
|
Metadata meta) throws DbException {
|
||||||
|
// Deliver the message to the client if it's registered a hook
|
||||||
IncomingMessageHook hook = hooks.get(c);
|
IncomingMessageHook hook = hooks.get(c);
|
||||||
if (hook == null) throw new DbException();
|
if (hook != null) hook.incomingMessage(txn, m, meta);
|
||||||
hook.incomingMessage(txn, m, meta);
|
|
||||||
// TODO: Find a better way for clients to signal validity, #643
|
// TODO: Find a better way for clients to signal validity, #643
|
||||||
if (db.getRawMessage(txn, m.getId()) == null) {
|
if (db.getRawMessage(txn, m.getId()) == null) {
|
||||||
db.setMessageState(txn, m.getId(), INVALID);
|
db.setMessageState(txn, m.getId(), INVALID);
|
||||||
|
|||||||
Reference in New Issue
Block a user