DatabaseComponent.generateAck() now returns a boolean.

The return value indicates whether any batch IDs were written.
AckWriter.finish() and Database.removeBatchesToAck() are only called
if at least one batch ID was written.
This commit is contained in:
akwizgran
2011-09-21 17:51:17 +01:00
parent fadd95ae49
commit 8dd7ec93e7
3 changed files with 30 additions and 9 deletions

View File

@@ -69,8 +69,11 @@ public interface DatabaseComponent {
/** Adds a locally generated private message to the database. */
void addLocalPrivateMessage(Message m, ContactId c) throws DbException;
/** Generates an acknowledgement for the given contact. */
void generateAck(ContactId c, AckWriter a) throws DbException,
/**
* Generates an acknowledgement for the given contact.
* @return True if any batch IDs were added to the acknowledgement.
*/
boolean generateAck(ContactId c, AckWriter a) throws DbException,
IOException;
/**