mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 19:59:05 +01:00
If no messages are added to a batch, don't call BatchWriter.finish() -
this allows the caller to avoid creating an empty packet by delaying creation of the packet's header and trailer until something's written to the packet's body. Changed the return semantics of DatabaseComponent.generateBatch(ContactId, BatchWriter, Collection<MessageId>) so that the IDs of messages considered for inclusion in the batch but no longer sendable are also returned - this allows the caller to remove them from the set of requested IDs.
This commit is contained in:
@@ -79,8 +79,9 @@ public interface DatabaseComponent {
|
||||
|
||||
/**
|
||||
* Generates a batch of messages for the given contact from the given
|
||||
* collection of requested messages, and returns the IDs of the messages
|
||||
* added to the bacth.
|
||||
* collection of requested messages, and returns the IDs of any messages
|
||||
* that were either added to the batch, or were considered for inclusion
|
||||
* but are no longer sendable to the contact.
|
||||
*/
|
||||
Collection<MessageId> generateBatch(ContactId c, BatchWriter b,
|
||||
Collection<MessageId> requested) throws DbException, IOException;
|
||||
|
||||
Reference in New Issue
Block a user