Add ConversationManager method for deleting all messages

Note that this does not yet delete special conversation messages
such as invitations or introductions and their responses.
This commit is contained in:
Torsten Grote
2019-10-03 14:47:12 -03:00
parent eda17449be
commit c46fdce277
6 changed files with 103 additions and 1 deletions

View File

@@ -24,7 +24,7 @@ public interface ConversationManager {
/**
* 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.
*/
@@ -36,6 +36,13 @@ public interface ConversationManager {
*/
GroupCount getGroupCount(ContactId c) throws DbException;
/**
* Deletes all messages exchanged with the given contact.
*
* @return true if all messages could be deleted, false otherwise
*/
boolean deleteAllMessages(ContactId c) throws DbException;
@NotNullByDefault
interface ConversationClient {
@@ -49,6 +56,14 @@ public interface ConversationManager {
void setReadFlag(GroupId g, MessageId m, boolean read)
throws DbException;
/**
* Deletes all messages associated with the given contact.
*
* @return true if all messages could be deleted, false otherwise
*/
boolean deleteAllMessages(Transaction txn,
ContactId c) throws DbException;
}
}