mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 12:19:54 +01:00
Refactor SharingManager so its events provide message header
This commit is contained in:
@@ -2,13 +2,15 @@ package org.briarproject.api.event;
|
||||
|
||||
import org.briarproject.api.blogs.Blog;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.sharing.InvitationRequest;
|
||||
|
||||
public class BlogInvitationReceivedEvent extends InvitationReceivedEvent {
|
||||
|
||||
private final Blog blog;
|
||||
|
||||
public BlogInvitationReceivedEvent(Blog blog, ContactId contactId) {
|
||||
super(contactId);
|
||||
public BlogInvitationReceivedEvent(Blog blog, ContactId contactId,
|
||||
InvitationRequest request) {
|
||||
super(contactId, request);
|
||||
this.blog = blog;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.briarproject.api.event;
|
||||
|
||||
import org.briarproject.api.blogs.BlogInvitationResponse;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
|
||||
public class BlogInvitationResponseReceivedEvent extends InvitationResponseReceivedEvent {
|
||||
@@ -7,8 +8,8 @@ public class BlogInvitationResponseReceivedEvent extends InvitationResponseRecei
|
||||
private final String blogTitle;
|
||||
|
||||
public BlogInvitationResponseReceivedEvent(String blogTitle,
|
||||
ContactId contactId) {
|
||||
super(contactId);
|
||||
ContactId contactId, BlogInvitationResponse response) {
|
||||
super(contactId, response);
|
||||
this.blogTitle = blogTitle;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,17 +2,20 @@ package org.briarproject.api.event;
|
||||
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.forum.Forum;
|
||||
import org.briarproject.api.forum.ForumInvitationRequest;
|
||||
|
||||
public class ForumInvitationReceivedEvent extends InvitationReceivedEvent {
|
||||
|
||||
private final Forum forum;
|
||||
|
||||
public ForumInvitationReceivedEvent(Forum forum, ContactId contactId) {
|
||||
super(contactId);
|
||||
public ForumInvitationReceivedEvent(Forum forum, ContactId contactId,
|
||||
ForumInvitationRequest request) {
|
||||
super(contactId, request);
|
||||
this.forum = forum;
|
||||
}
|
||||
|
||||
public Forum getForum() {
|
||||
return forum;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
package org.briarproject.api.event;
|
||||
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.forum.ForumInvitationResponse;
|
||||
|
||||
public class ForumInvitationResponseReceivedEvent extends InvitationResponseReceivedEvent {
|
||||
|
||||
private final String forumName;
|
||||
|
||||
public ForumInvitationResponseReceivedEvent(String forumName,
|
||||
ContactId contactId) {
|
||||
super(contactId);
|
||||
ContactId contactId, ForumInvitationResponse response) {
|
||||
super(contactId, response);
|
||||
this.forumName = forumName;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,23 @@
|
||||
package org.briarproject.api.event;
|
||||
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.sharing.InvitationRequest;
|
||||
|
||||
public abstract class InvitationReceivedEvent extends Event {
|
||||
|
||||
private final ContactId contactId;
|
||||
private final InvitationRequest request;
|
||||
|
||||
InvitationReceivedEvent(ContactId contactId) {
|
||||
InvitationReceivedEvent(ContactId contactId, InvitationRequest request) {
|
||||
this.contactId = contactId;
|
||||
this.request = request;
|
||||
}
|
||||
|
||||
public ContactId getContactId() {
|
||||
return contactId;
|
||||
}
|
||||
|
||||
public InvitationRequest getRequest() {
|
||||
return request;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,24 @@
|
||||
package org.briarproject.api.event;
|
||||
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.sharing.InvitationResponse;
|
||||
|
||||
public abstract class InvitationResponseReceivedEvent extends Event {
|
||||
|
||||
private final ContactId contactId;
|
||||
private final InvitationResponse response;
|
||||
|
||||
public InvitationResponseReceivedEvent(ContactId contactId) {
|
||||
public InvitationResponseReceivedEvent(ContactId contactId,
|
||||
InvitationResponse response) {
|
||||
this.contactId = contactId;
|
||||
this.response = response;
|
||||
}
|
||||
|
||||
public ContactId getContactId() {
|
||||
return contactId;
|
||||
}
|
||||
|
||||
public InvitationResponse getResponse() {
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user