mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Refactor events based on InvitationRequestReceivedEvent
This commit is contained in:
@@ -5,17 +5,11 @@ import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.sharing.InvitationRequest;
|
||||
|
||||
public class BlogInvitationReceivedEvent extends
|
||||
InvitationRequestReceivedEvent {
|
||||
|
||||
private final Blog blog;
|
||||
InvitationRequestReceivedEvent<Blog> {
|
||||
|
||||
public BlogInvitationReceivedEvent(Blog blog, ContactId contactId,
|
||||
InvitationRequest request) {
|
||||
super(contactId, request);
|
||||
this.blog = blog;
|
||||
super(blog, contactId, request);
|
||||
}
|
||||
|
||||
public Blog getBlog() {
|
||||
return blog;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,18 +5,11 @@ import org.briarproject.api.forum.Forum;
|
||||
import org.briarproject.api.forum.ForumInvitationRequest;
|
||||
|
||||
public class ForumInvitationReceivedEvent extends
|
||||
InvitationRequestReceivedEvent {
|
||||
|
||||
private final Forum forum;
|
||||
InvitationRequestReceivedEvent<Forum> {
|
||||
|
||||
public ForumInvitationReceivedEvent(Forum forum, ContactId contactId,
|
||||
ForumInvitationRequest request) {
|
||||
super(contactId, request);
|
||||
this.forum = forum;
|
||||
}
|
||||
|
||||
public Forum getForum() {
|
||||
return forum;
|
||||
super(forum, contactId, request);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.briarproject.api.event;
|
||||
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.forum.ForumInvitationRequest;
|
||||
import org.briarproject.api.privategroup.PrivateGroup;
|
||||
|
||||
public class GroupInvitationReceivedEvent extends
|
||||
InvitationRequestReceivedEvent<PrivateGroup> {
|
||||
|
||||
public GroupInvitationReceivedEvent(PrivateGroup group, ContactId contactId,
|
||||
ForumInvitationRequest request) {
|
||||
super(group, contactId, request);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,14 +2,18 @@ package org.briarproject.api.event;
|
||||
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.sharing.InvitationRequest;
|
||||
import org.briarproject.api.sharing.Shareable;
|
||||
|
||||
public abstract class InvitationRequestReceivedEvent extends Event {
|
||||
public abstract class InvitationRequestReceivedEvent<S extends Shareable>
|
||||
extends Event {
|
||||
|
||||
private final S shareable;
|
||||
private final ContactId contactId;
|
||||
private final InvitationRequest request;
|
||||
|
||||
InvitationRequestReceivedEvent(ContactId contactId,
|
||||
InvitationRequestReceivedEvent(S shareable, ContactId contactId,
|
||||
InvitationRequest request) {
|
||||
this.shareable = shareable;
|
||||
this.contactId = contactId;
|
||||
this.request = request;
|
||||
}
|
||||
@@ -21,4 +25,8 @@ public abstract class InvitationRequestReceivedEvent extends Event {
|
||||
public InvitationRequest getRequest() {
|
||||
return request;
|
||||
}
|
||||
|
||||
public S getShareable() {
|
||||
return shareable;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user