add transactional versions of some API calls

This commit is contained in:
ialokim
2021-12-06 21:08:05 +01:00
parent 8d5803098b
commit d29812f055
6 changed files with 55 additions and 15 deletions

View File

@@ -38,6 +38,15 @@ public interface ConversationManager {
Collection<ConversationMessageHeader> getMessageHeaders(ContactId c)
throws DbException;
/**
* Returns the headers of all messages in the given private conversation.
* <p>
* Only {@link MessagingManager} returns only headers.
* The others also return the message text.
*/
Collection<ConversationMessageHeader> getMessageHeaders(Transaction txn, ContactId c)
throws DbException;
/**
* Returns the unified group count for all private conversation messages.
*/
@@ -72,6 +81,9 @@ public interface ConversationManager {
void setReadFlag(GroupId g, MessageId m, boolean read)
throws DbException;
void setReadFlag(Transaction txn, GroupId g, MessageId m, boolean read)
throws DbException;
/**
* Returns a timestamp for an outgoing message, which is later than the
* timestamp of any message in the conversation with the given contact.

View File

@@ -74,6 +74,13 @@ public interface MessagingManager extends ConversationClient {
@Nullable
String getMessageText(MessageId m) throws DbException;
/**
* Returns the text of the private message with the given ID, or null if
* the private message has no text.
*/
@Nullable
String getMessageText(Transaction txn, MessageId m) throws DbException;
/**
* Returns the private message format supported by the given contact.
*/