mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 03:39:05 +01:00
Merge branch 'validation-hooks' into 'master'
Run hooks when messages are validated This patch allows clients to respond to messages reliably. Like the hooks for adding/removing contacts/identities, these hooks may be run more than once - that will be fixed when we have client-layer transactions. See merge request !95
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package org.briarproject.api.sync;
|
||||
|
||||
import org.briarproject.api.db.Metadata;
|
||||
|
||||
/**
|
||||
* Responsible for managing message validators and passing them messages to
|
||||
* validate.
|
||||
@@ -28,4 +30,11 @@ public interface ValidationManager {
|
||||
|
||||
/** Sets the message validator for the given client. */
|
||||
void registerMessageValidator(ClientId c, MessageValidator v);
|
||||
|
||||
/** Registers a hook to be called whenever a message is validated. */
|
||||
void registerValidationHook(ValidationHook hook);
|
||||
|
||||
interface ValidationHook {
|
||||
void validatingMessage(Message m, ClientId c, Metadata meta);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user