mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 05:09:53 +01:00
Add sharing information to toolbar subtitle of blogs
The toolbar subtitle shows information about how many contacts the current blog is shared with and how many of those are online.
This commit is contained in:
@@ -357,7 +357,8 @@ class BlogSharingManagerImpl extends
|
||||
throw new IllegalStateException("No responseId");
|
||||
BlogInvitationResponse response =
|
||||
new BlogInvitationResponse(responseId,
|
||||
localState.getSessionId(), localState.getGroupId(),
|
||||
localState.getSessionId(),
|
||||
localState.getShareableId(),
|
||||
localState.getContactId(), accept, time, false,
|
||||
false, false, false);
|
||||
return new BlogInvitationResponseReceivedEvent(c, response);
|
||||
|
||||
@@ -287,8 +287,8 @@ class ForumSharingManagerImpl extends
|
||||
throw new IllegalStateException("No responseId");
|
||||
ForumInvitationResponse response = new ForumInvitationResponse(
|
||||
responseId, localState.getSessionId(),
|
||||
localState.getGroupId(), localState.getContactId(), accept,
|
||||
time, false, false, false, false);
|
||||
localState.getShareableId(), localState.getContactId(),
|
||||
accept, time, false, false, false, false);
|
||||
return new ForumInvitationResponseReceivedEvent(name, c, response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,10 @@ package org.briarproject.briar.sharing;
|
||||
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
|
||||
import org.briarproject.briar.api.sharing.event.InvitationRequestReceivedEvent;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@NotNullByDefault
|
||||
interface InvitationReceivedEventFactory<IS extends InviteeSessionState, IR extends InvitationRequestReceivedEvent> {
|
||||
|
||||
IR build(IS localState, long time, String msg);
|
||||
IR build(IS localState, long time, @Nullable String msg);
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ import org.briarproject.briar.api.sharing.SharingInvitationItem;
|
||||
import org.briarproject.briar.api.sharing.SharingManager;
|
||||
import org.briarproject.briar.api.sharing.event.InvitationRequestReceivedEvent;
|
||||
import org.briarproject.briar.api.sharing.event.InvitationResponseReceivedEvent;
|
||||
import org.briarproject.briar.api.sharing.event.ShareableLeftEvent;
|
||||
import org.briarproject.briar.client.ConversationClientImpl;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -897,9 +898,15 @@ abstract class SharingManagerImpl<S extends Shareable, I extends Invitation, IS
|
||||
} else if (task == TASK_UNSHARE_SHAREABLE_SHARED_BY_US) {
|
||||
db.setGroupVisibility(txn, contactId, f.getId(), INVISIBLE);
|
||||
removeFromList(txn, groupId, SHARED_BY_US, f);
|
||||
// broadcast event informing UI that contact has left the group
|
||||
ShareableLeftEvent e = new ShareableLeftEvent(f.getId(), contactId);
|
||||
txn.attach(e);
|
||||
} else if (task == TASK_UNSHARE_SHAREABLE_SHARED_WITH_US) {
|
||||
db.setGroupVisibility(txn, contactId, f.getId(), INVISIBLE);
|
||||
removeFromList(txn, groupId, SHARED_WITH_US, f);
|
||||
// broadcast event informing UI that contact has left the group
|
||||
ShareableLeftEvent e = new ShareableLeftEvent(f.getId(), contactId);
|
||||
txn.attach(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user