mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 03:39:05 +01:00
add transactional versions to functions related to forums
This commit is contained in:
@@ -48,6 +48,11 @@ public interface ForumManager {
|
||||
*/
|
||||
void removeForum(Forum f) throws DbException;
|
||||
|
||||
/**
|
||||
* Unsubscribes from a forum.
|
||||
*/
|
||||
void removeForum(Transaction txn, Forum f) throws DbException;
|
||||
|
||||
/**
|
||||
* Creates a local forum post.
|
||||
*/
|
||||
@@ -127,6 +132,11 @@ public interface ForumManager {
|
||||
*/
|
||||
void setReadFlag(GroupId g, MessageId m, boolean read) throws DbException;
|
||||
|
||||
/**
|
||||
* Marks a message as read or unread and updates the group count.
|
||||
*/
|
||||
void setReadFlag(Transaction txn, GroupId g, MessageId m, boolean read) throws DbException;
|
||||
|
||||
interface RemoveForumHook {
|
||||
/**
|
||||
* Called when a forum is being removed.
|
||||
|
||||
@@ -24,23 +24,48 @@ public interface SharingManager<S extends Shareable>
|
||||
void sendInvitation(GroupId shareableId, ContactId contactId,
|
||||
@Nullable String text) throws DbException;
|
||||
|
||||
/**
|
||||
* Sends an invitation to share the given group with the given contact,
|
||||
* including optional text.
|
||||
*/
|
||||
void sendInvitation(Transaction txn, GroupId shareableId,
|
||||
ContactId contactId, @Nullable String text) throws DbException;
|
||||
|
||||
/**
|
||||
* Responds to a pending group invitation
|
||||
*/
|
||||
void respondToInvitation(S s, Contact c, boolean accept)
|
||||
throws DbException;
|
||||
|
||||
/**
|
||||
* Responds to a pending group invitation
|
||||
*/
|
||||
void respondToInvitation(Transaction txn, S s, Contact c, boolean accept)
|
||||
throws DbException;
|
||||
|
||||
/**
|
||||
* Responds to a pending group invitation
|
||||
*/
|
||||
void respondToInvitation(ContactId c, SessionId id, boolean accept)
|
||||
throws DbException;
|
||||
|
||||
/**
|
||||
* Responds to a pending group invitation
|
||||
*/
|
||||
void respondToInvitation(Transaction txn, ContactId c, SessionId id,
|
||||
boolean accept) throws DbException;
|
||||
|
||||
/**
|
||||
* Returns all invitations to groups.
|
||||
*/
|
||||
Collection<SharingInvitationItem> getInvitations() throws DbException;
|
||||
|
||||
/**
|
||||
* Returns all invitations to groups.
|
||||
*/
|
||||
Collection<SharingInvitationItem> getInvitations(Transaction txn)
|
||||
throws DbException;
|
||||
|
||||
/**
|
||||
* Returns all contacts with whom the given group is shared.
|
||||
*/
|
||||
@@ -57,4 +82,10 @@ public interface SharingManager<S extends Shareable>
|
||||
*/
|
||||
boolean canBeShared(GroupId g, Contact c) throws DbException;
|
||||
|
||||
/**
|
||||
* Returns true if the group not already shared and no invitation is open
|
||||
*/
|
||||
boolean canBeShared(Transaction txn, GroupId g, Contact c)
|
||||
throws DbException;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user