mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 11:49:04 +01:00
Show Responses to Forum Invitations in Private Conversation
Closes #472
This commit is contained in:
@@ -3,13 +3,14 @@ package org.briarproject.api.blogs;
|
||||
import org.briarproject.api.clients.SessionId;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.sharing.InvitationMessage;
|
||||
import org.briarproject.api.sharing.InvitationRequest;
|
||||
import org.briarproject.api.sync.MessageId;
|
||||
|
||||
public class BlogInvitationMessage extends InvitationMessage {
|
||||
public class BlogInvitationRequest extends InvitationRequest {
|
||||
|
||||
private final String blogTitle;
|
||||
|
||||
public BlogInvitationMessage(MessageId id, SessionId sessionId,
|
||||
public BlogInvitationRequest(MessageId id, SessionId sessionId,
|
||||
ContactId contactId, String blogTitle, String message,
|
||||
boolean available, long time, boolean local, boolean sent,
|
||||
boolean seen, boolean read) {
|
||||
@@ -10,7 +10,7 @@ import org.briarproject.api.sync.GroupId;
|
||||
import java.util.Collection;
|
||||
|
||||
public interface BlogSharingManager
|
||||
extends SharingManager<Blog, BlogInvitationMessage> {
|
||||
extends SharingManager<Blog, BlogInvitationRequest> {
|
||||
|
||||
/**
|
||||
* Returns the unique ID of the blog sharing client.
|
||||
@@ -34,7 +34,7 @@ public interface BlogSharingManager
|
||||
* Returns all blogs sharing messages sent by the Contact
|
||||
* identified by contactId.
|
||||
*/
|
||||
Collection<BlogInvitationMessage> getInvitationMessages(
|
||||
Collection<BlogInvitationRequest> getInvitationMessages(
|
||||
ContactId contactId) throws DbException;
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,15 +2,14 @@ package org.briarproject.api.forum;
|
||||
|
||||
import org.briarproject.api.clients.SessionId;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.messaging.BaseMessage;
|
||||
import org.briarproject.api.sharing.InvitationMessage;
|
||||
import org.briarproject.api.sharing.InvitationRequest;
|
||||
import org.briarproject.api.sync.MessageId;
|
||||
|
||||
public class ForumInvitationMessage extends InvitationMessage {
|
||||
public class ForumInvitationRequest extends InvitationRequest {
|
||||
|
||||
private final String forumName;
|
||||
|
||||
public ForumInvitationMessage(MessageId id, SessionId sessionId,
|
||||
public ForumInvitationRequest(MessageId id, SessionId sessionId,
|
||||
ContactId contactId, String forumName, String message,
|
||||
boolean available, long time, boolean local, boolean sent,
|
||||
boolean seen, boolean read) {
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.briarproject.api.forum;
|
||||
|
||||
import org.briarproject.api.clients.SessionId;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.sharing.InvitationResponse;
|
||||
import org.briarproject.api.sync.MessageId;
|
||||
|
||||
public class ForumInvitationResponse extends InvitationResponse {
|
||||
|
||||
public ForumInvitationResponse(MessageId id, SessionId sessionId,
|
||||
ContactId contactId, boolean accept, long time, boolean local,
|
||||
boolean sent, boolean seen, boolean read) {
|
||||
|
||||
super(id, sessionId, contactId, accept, time, local, sent, seen, read);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,13 +3,14 @@ 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.InvitationMessage;
|
||||
import org.briarproject.api.sharing.SharingManager;
|
||||
import org.briarproject.api.sync.ClientId;
|
||||
import org.briarproject.api.sync.GroupId;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public interface ForumSharingManager extends SharingManager<Forum, ForumInvitationMessage> {
|
||||
public interface ForumSharingManager extends SharingManager<Forum, InvitationMessage> {
|
||||
|
||||
/** Returns the unique ID of the forum sharing client. */
|
||||
ClientId getClientId();
|
||||
@@ -31,7 +32,7 @@ public interface ForumSharingManager extends SharingManager<Forum, ForumInvitati
|
||||
* Returns all forum sharing messages sent by the Contact
|
||||
* identified by contactId.
|
||||
*/
|
||||
Collection<ForumInvitationMessage> getInvitationMessages(
|
||||
Collection<InvitationMessage> getInvitationMessages(
|
||||
ContactId contactId) throws DbException;
|
||||
|
||||
/** Returns all forums to which the user has been invited. */
|
||||
|
||||
@@ -9,19 +9,14 @@ public abstract class InvitationMessage extends BaseMessage {
|
||||
|
||||
private final SessionId sessionId;
|
||||
private final ContactId contactId;
|
||||
private final String message;
|
||||
private final boolean available;
|
||||
|
||||
public InvitationMessage(MessageId id, SessionId sessionId,
|
||||
ContactId contactId, String message,
|
||||
boolean available, long time, boolean local, boolean sent,
|
||||
ContactId contactId, long time, boolean local, boolean sent,
|
||||
boolean seen, boolean read) {
|
||||
|
||||
super(id, time, local, read, sent, seen);
|
||||
this.sessionId = sessionId;
|
||||
this.contactId = contactId;
|
||||
this.message = message;
|
||||
this.available = available;
|
||||
}
|
||||
|
||||
public SessionId getSessionId() {
|
||||
@@ -32,12 +27,4 @@ public abstract class InvitationMessage extends BaseMessage {
|
||||
return contactId;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public boolean isAvailable() {
|
||||
return available;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.briarproject.api.sharing;
|
||||
|
||||
import org.briarproject.api.clients.SessionId;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.sync.MessageId;
|
||||
|
||||
public abstract class InvitationRequest extends InvitationMessage {
|
||||
|
||||
private final String message;
|
||||
private final boolean available;
|
||||
|
||||
public InvitationRequest(MessageId id, SessionId sessionId,
|
||||
ContactId contactId, String message,
|
||||
boolean available, long time, boolean local, boolean sent,
|
||||
boolean seen, boolean read) {
|
||||
|
||||
super(id, sessionId, contactId, time, local, read, sent, seen);
|
||||
this.message = message;
|
||||
this.available = available;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public boolean isAvailable() {
|
||||
return available;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package org.briarproject.api.sharing;
|
||||
|
||||
import org.briarproject.api.clients.SessionId;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.sync.MessageId;
|
||||
|
||||
public abstract class InvitationResponse extends InvitationMessage {
|
||||
|
||||
private final boolean accept;
|
||||
|
||||
public InvitationResponse(MessageId id, SessionId sessionId,
|
||||
ContactId contactId, boolean accept, long time, boolean local,
|
||||
boolean sent, boolean seen, boolean read) {
|
||||
|
||||
super(id, sessionId, contactId, time, local, read, sent, seen);
|
||||
this.accept = accept;
|
||||
}
|
||||
|
||||
public boolean wasAccepted() {
|
||||
return accept;
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,6 @@ public interface SharingMessage {
|
||||
private final SessionId sessionId;
|
||||
|
||||
BaseMessage(GroupId groupId, SessionId sessionId) {
|
||||
|
||||
this.groupId = groupId;
|
||||
this.sessionId = sessionId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user