mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
@@ -3,6 +3,7 @@ package org.briarproject.api.blogs;
|
||||
import org.briarproject.api.contact.Contact;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.db.DbException;
|
||||
import org.briarproject.api.sharing.InvitationItem;
|
||||
import org.briarproject.api.sharing.InvitationMessage;
|
||||
import org.briarproject.api.sharing.SharingManager;
|
||||
import org.briarproject.api.sync.ClientId;
|
||||
@@ -40,7 +41,7 @@ public interface BlogSharingManager extends SharingManager<Blog> {
|
||||
/**
|
||||
* Returns all blogs to which the user has been invited.
|
||||
*/
|
||||
Collection<Blog> getInvited() throws DbException;
|
||||
Collection<InvitationItem> getInvitations() throws DbException;
|
||||
|
||||
/**
|
||||
* Returns all contacts who are sharing the given blog with us.
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.briarproject.api.forum;
|
||||
import org.briarproject.api.contact.Contact;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.db.DbException;
|
||||
import org.briarproject.api.sharing.InvitationItem;
|
||||
import org.briarproject.api.sharing.InvitationMessage;
|
||||
import org.briarproject.api.sharing.SharingManager;
|
||||
import org.briarproject.api.sync.ClientId;
|
||||
@@ -36,7 +37,7 @@ public interface ForumSharingManager extends SharingManager<Forum> {
|
||||
ContactId contactId) throws DbException;
|
||||
|
||||
/** Returns all forums to which the user has been invited. */
|
||||
Collection<Forum> getInvited() throws DbException;
|
||||
Collection<InvitationItem> getInvitations() throws DbException;
|
||||
|
||||
/** Returns all contacts who are sharing the given forum with us. */
|
||||
Collection<Contact> getSharedBy(GroupId g) throws DbException;
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package org.briarproject.api.sharing;
|
||||
|
||||
import org.briarproject.api.contact.Contact;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class InvitationItem {
|
||||
|
||||
private final Shareable shareable;
|
||||
private final boolean subscribed;
|
||||
private final Collection<Contact> newSharers;
|
||||
|
||||
public InvitationItem(Shareable shareable, boolean subscribed,
|
||||
Collection<Contact> newSharers) {
|
||||
|
||||
this.shareable = shareable;
|
||||
this.subscribed = subscribed;
|
||||
this.newSharers = newSharers;
|
||||
}
|
||||
|
||||
public Shareable getShareable() {
|
||||
return shareable;
|
||||
}
|
||||
|
||||
public boolean isSubscribed() {
|
||||
return subscribed;
|
||||
}
|
||||
|
||||
public Collection<Contact> getNewSharers() {
|
||||
return newSharers;
|
||||
}
|
||||
}
|
||||
@@ -33,8 +33,8 @@ public interface SharingManager<S extends Shareable> {
|
||||
Collection<InvitationMessage> getInvitationMessages(
|
||||
ContactId contactId) throws DbException;
|
||||
|
||||
/** Returns all shareables to which the user has been invited. */
|
||||
Collection<S> getInvited() throws DbException;
|
||||
/** Returns all invitations to shareables. */
|
||||
Collection<InvitationItem> getInvitations() throws DbException;
|
||||
|
||||
/** Returns all contacts who are sharing the given group with us. */
|
||||
Collection<Contact> getSharedBy(GroupId g) throws DbException;
|
||||
|
||||
Reference in New Issue
Block a user