mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 03:39:05 +01:00
Factor out generic sharing code from ForumSharingManger
This commit is contained in:
@@ -352,7 +352,7 @@ public class ContactListFragment extends BaseFragment implements EventListener {
|
||||
|
||||
now = System.currentTimeMillis();
|
||||
Collection<ForumInvitationMessage> invitations =
|
||||
forumSharingManager.getForumInvitationMessages(id);
|
||||
forumSharingManager.getInvitationMessages(id);
|
||||
for (ForumInvitationMessage i : invitations) {
|
||||
messages.add(ConversationItem.from(i));
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ public class ConversationActivity extends BriarActivity
|
||||
.getIntroductionMessages(contactId);
|
||||
Collection<ForumInvitationMessage> invitations =
|
||||
forumSharingManager
|
||||
.getForumInvitationMessages(contactId);
|
||||
.getInvitationMessages(contactId);
|
||||
long duration = System.currentTimeMillis() - now;
|
||||
if (LOG.isLoggable(INFO))
|
||||
LOG.info("Loading headers took " + duration + " ms");
|
||||
|
||||
@@ -82,7 +82,7 @@ public class AvailableForumsActivity extends BriarActivity
|
||||
try {
|
||||
Collection<ForumContacts> available = new ArrayList<>();
|
||||
long now = System.currentTimeMillis();
|
||||
for (Forum f : forumSharingManager.getAvailableForums()) {
|
||||
for (Forum f : forumSharingManager.getAvailable()) {
|
||||
try {
|
||||
Collection<Contact> c =
|
||||
forumSharingManager.getSharedBy(f.getId());
|
||||
|
||||
@@ -38,7 +38,7 @@ import static java.util.logging.Level.INFO;
|
||||
import static java.util.logging.Level.WARNING;
|
||||
import static org.briarproject.android.forum.ShareForumActivity.CONTACTS;
|
||||
import static org.briarproject.android.forum.ShareForumActivity.getContactsFromIds;
|
||||
import static org.briarproject.api.forum.ForumConstants.GROUP_ID;
|
||||
import static org.briarproject.api.sharing.SharingConstants.GROUP_ID;
|
||||
|
||||
public class ContactSelectorFragment extends BaseFragment implements
|
||||
BaseContactListAdapter.OnItemClickListener {
|
||||
|
||||
@@ -177,7 +177,7 @@ public class ForumListFragment extends BaseEventFragment implements
|
||||
try {
|
||||
long now = System.currentTimeMillis();
|
||||
int available =
|
||||
forumSharingManager.getAvailableForums().size();
|
||||
forumSharingManager.getAvailable().size();
|
||||
long duration = System.currentTimeMillis() - now;
|
||||
if (LOG.isLoggable(INFO))
|
||||
LOG.info("Loading available took " + duration + " ms");
|
||||
|
||||
@@ -28,7 +28,7 @@ import static android.widget.Toast.LENGTH_SHORT;
|
||||
import static java.util.logging.Level.WARNING;
|
||||
import static org.briarproject.android.forum.ShareForumActivity.CONTACTS;
|
||||
import static org.briarproject.android.forum.ShareForumActivity.getContactsFromIds;
|
||||
import static org.briarproject.api.forum.ForumConstants.GROUP_ID;
|
||||
import static org.briarproject.api.sharing.SharingConstants.GROUP_ID;
|
||||
|
||||
public class ShareForumMessageFragment extends BaseFragment {
|
||||
|
||||
@@ -136,7 +136,7 @@ public class ShareForumMessageFragment extends BaseFragment {
|
||||
public void run() {
|
||||
try {
|
||||
for (ContactId c : contacts) {
|
||||
forumSharingManager.sendForumInvitation(groupId, c,
|
||||
forumSharingManager.sendInvitation(groupId, c,
|
||||
msg);
|
||||
}
|
||||
} catch (DbException e) {
|
||||
|
||||
Reference in New Issue
Block a user