mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Re-introduce InvitationResponse
This was done, so private responses don't need to include a Nameable already. Retreiving a nameable is tricky and requires a data migration, so we just don't do it now.
This commit is contained in:
@@ -21,11 +21,11 @@ import org.briarproject.briar.android.controller.ActivityLifecycleController;
|
||||
import org.briarproject.briar.android.controller.handler.ResultExceptionHandler;
|
||||
import org.briarproject.briar.api.android.AndroidNotificationManager;
|
||||
import org.briarproject.briar.api.blog.Blog;
|
||||
import org.briarproject.briar.api.blog.BlogInvitationResponse;
|
||||
import org.briarproject.briar.api.blog.BlogManager;
|
||||
import org.briarproject.briar.api.blog.BlogSharingManager;
|
||||
import org.briarproject.briar.api.blog.event.BlogInvitationResponseReceivedEvent;
|
||||
import org.briarproject.briar.api.blog.event.BlogPostAddedEvent;
|
||||
import org.briarproject.briar.api.messaging.PrivateResponse;
|
||||
import org.briarproject.briar.api.sharing.event.ContactLeftShareableEvent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -107,8 +107,8 @@ class BlogControllerImpl extends BaseControllerImpl
|
||||
} else if (e instanceof BlogInvitationResponseReceivedEvent) {
|
||||
BlogInvitationResponseReceivedEvent b =
|
||||
(BlogInvitationResponseReceivedEvent) e;
|
||||
PrivateResponse<Blog> r = b.getMessageHeader();
|
||||
if (r.getNameable().getId().equals(groupId) && r.wasAccepted()) {
|
||||
BlogInvitationResponse r = b.getMessageHeader();
|
||||
if (r.getShareableId().equals(groupId) && r.wasAccepted()) {
|
||||
LOG.info("Blog invitation accepted");
|
||||
onBlogInvitationAccepted(b.getContactId());
|
||||
}
|
||||
|
||||
@@ -167,14 +167,14 @@ abstract class ConversationItem {
|
||||
if (ir.wasAccepted()) {
|
||||
text = ctx.getString(
|
||||
R.string.introduction_response_accepted_sent,
|
||||
ir.getNameable().getName());
|
||||
ir.getIntroducedAuthor().getName());
|
||||
text += "\n\n" + ctx.getString(
|
||||
R.string.introduction_response_accepted_sent_info,
|
||||
ir.getNameable().getName());
|
||||
ir.getIntroducedAuthor().getName());
|
||||
} else {
|
||||
text = ctx.getString(
|
||||
R.string.introduction_response_declined_sent,
|
||||
ir.getNameable().getName());
|
||||
ir.getIntroducedAuthor().getName());
|
||||
}
|
||||
return new ConversationNoticeOutItem(ir.getId(), ir.getGroupId(),
|
||||
text, null, ir.getTimestamp(), ir.isSent(), ir.isSeen());
|
||||
@@ -191,7 +191,7 @@ abstract class ConversationItem {
|
||||
}
|
||||
}
|
||||
String text =
|
||||
ctx.getString(res, contactName, ir.getNameable().getName());
|
||||
ctx.getString(res, contactName, ir.getIntroducedAuthor().getName());
|
||||
return new ConversationNoticeInItem(ir.getId(), ir.getGroupId(),
|
||||
text, null, ir.getTimestamp(), ir.isRead());
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ class ForumControllerImpl extends
|
||||
ForumInvitationResponseReceivedEvent f =
|
||||
(ForumInvitationResponseReceivedEvent) e;
|
||||
ForumInvitationResponse r = f.getMessageHeader();
|
||||
if (r.getNameable().getId().equals(getGroupId()) && r.wasAccepted()) {
|
||||
if (r.getShareableId().equals(getGroupId()) && r.wasAccepted()) {
|
||||
LOG.info("Forum invitation was accepted");
|
||||
onForumInvitationAccepted(f.getContactId());
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ class GroupControllerImpl extends
|
||||
GroupInvitationResponseReceivedEvent g =
|
||||
(GroupInvitationResponseReceivedEvent) e;
|
||||
GroupInvitationResponse r = g.getMessageHeader();
|
||||
if (getGroupId().equals(r.getNameable().getId()) && r.wasAccepted()) {
|
||||
if (getGroupId().equals(r.getShareableId()) && r.wasAccepted()) {
|
||||
listener.runOnUiThreadUnlessDestroyed(
|
||||
() -> listener.onInvitationAccepted(g.getContactId()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user