mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Support for multi-device.
1) In addition to the Recipient interface, there is now RecipientDevice. A Recipient can have multiple corresponding RecipientDevices. All addressing is done to a Recipient, but crypto sessions and transport delivery are done to RecipientDevice. 2) The Push transport handles the discovery and session setup of additional Recipient devices. 3) Some internal rejiggering of Groups.
This commit is contained in:
@@ -19,15 +19,10 @@ package org.thoughtcrime.securesms;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentPagerAdapter;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.support.v4.view.ViewPager;
|
||||
|
||||
import org.thoughtcrime.securesms.recipients.Recipients;
|
||||
import org.thoughtcrime.securesms.util.ActionBarUtil;
|
||||
import org.thoughtcrime.securesms.util.DynamicTheme;
|
||||
|
||||
import com.actionbarsherlock.app.ActionBar;
|
||||
import com.actionbarsherlock.app.ActionBar.Tab;
|
||||
import com.actionbarsherlock.app.ActionBar.TabListener;
|
||||
@@ -35,6 +30,14 @@ import com.actionbarsherlock.view.Menu;
|
||||
import com.actionbarsherlock.view.MenuInflater;
|
||||
import com.actionbarsherlock.view.MenuItem;
|
||||
|
||||
import org.thoughtcrime.securesms.util.ActionBarUtil;
|
||||
import org.thoughtcrime.securesms.util.DynamicTheme;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.thoughtcrime.securesms.contacts.ContactAccessor.ContactData;
|
||||
|
||||
/**
|
||||
* Activity container for selecting a list of contacts. Provides a tab frame for
|
||||
* contact, group, and "recent contact" activity tabs. Used by ComposeMessageActivity
|
||||
@@ -52,8 +55,6 @@ public class ContactSelectionActivity extends PassphraseRequiredSherlockFragment
|
||||
private ContactSelectionGroupsFragment groupsFragment;
|
||||
private ContactSelectionRecentFragment recentFragment;
|
||||
|
||||
private Recipients recipients;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle icicle) {
|
||||
dynamicTheme.onCreate(this);
|
||||
@@ -97,12 +98,12 @@ public class ContactSelectionActivity extends PassphraseRequiredSherlockFragment
|
||||
}
|
||||
|
||||
private void handleSelectionFinished() {
|
||||
recipients = contactsFragment.getSelectedContacts();
|
||||
recipients.append(recentFragment.getSelectedContacts());
|
||||
recipients.append(groupsFragment.getSelectedContacts(this));
|
||||
List<ContactData> contacts = contactsFragment.getSelectedContacts();
|
||||
contacts.addAll(recentFragment.getSelectedContacts());
|
||||
contacts.addAll(groupsFragment.getSelectedContacts(this));
|
||||
|
||||
Intent resultIntent = getIntent();
|
||||
resultIntent.putExtra("recipients", this.recipients);
|
||||
resultIntent.putParcelableArrayListExtra("contacts", new ArrayList<ContactData>(contacts));
|
||||
|
||||
setResult(RESULT_OK, resultIntent);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user