mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 12:49:55 +01:00
UI for Sharing Blogs
This commit refactors the code for sharing forums, so it can be used for sharing blogs as well. It does not yet include code for responding to blog invitations.
This commit is contained in:
@@ -12,6 +12,7 @@ import org.briarproject.api.clients.ClientHelper;
|
||||
import org.briarproject.api.clients.MessageQueueManager;
|
||||
import org.briarproject.api.clients.PrivateGroupFactory;
|
||||
import org.briarproject.api.clients.SessionId;
|
||||
import org.briarproject.api.contact.Contact;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.data.BdfDictionary;
|
||||
import org.briarproject.api.data.BdfList;
|
||||
@@ -47,6 +48,8 @@ class BlogSharingManagerImpl extends
|
||||
"bee438b5de0b3a685badc4e49d76e72d"
|
||||
+ "21e01c4b569a775112756bdae267a028"));
|
||||
|
||||
private final BlogManager blogManager;
|
||||
|
||||
private final SFactory sFactory;
|
||||
private final IFactory iFactory;
|
||||
private final ISFactory isFactory;
|
||||
@@ -64,6 +67,7 @@ class BlogSharingManagerImpl extends
|
||||
super(db, messageQueueManager, clientHelper, metadataParser,
|
||||
metadataEncoder, random, privateGroupFactory, clock);
|
||||
|
||||
this.blogManager = blogManager;
|
||||
sFactory = new SFactory(authorFactory, blogFactory, blogManager);
|
||||
iFactory = new IFactory();
|
||||
isFactory = new ISFactory();
|
||||
@@ -77,6 +81,13 @@ class BlogSharingManagerImpl extends
|
||||
return CLIENT_ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeShared(GroupId g, Contact c) throws DbException {
|
||||
Blog b = blogManager.getPersonalBlog(c.getAuthor());
|
||||
if (b.getId().equals(g)) return false;
|
||||
return super.canBeShared(g, c);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlogInvitationRequest createInvitationRequest(MessageId id,
|
||||
BlogInvitation msg, ContactId contactId, boolean available,
|
||||
|
||||
@@ -27,6 +27,8 @@ public class SharingModule {
|
||||
ForumSharingValidator forumSharingValidator;
|
||||
@Inject
|
||||
ForumSharingManager forumSharingManager;
|
||||
@Inject
|
||||
BlogSharingManager blogSharingManager;
|
||||
}
|
||||
|
||||
@Provides
|
||||
|
||||
Reference in New Issue
Block a user