diff --git a/src/org/thoughtcrime/securesms/SingleContactSelectionActivity.java b/src/org/thoughtcrime/securesms/SingleContactSelectionActivity.java index 339334098c..7cbe64593a 100644 --- a/src/org/thoughtcrime/securesms/SingleContactSelectionActivity.java +++ b/src/org/thoughtcrime/securesms/SingleContactSelectionActivity.java @@ -94,16 +94,18 @@ public class SingleContactSelectionActivity extends PassphraseRequiredSherlockFr private Recipients contactDataToRecipients(ContactData contactData) { if (contactData == null || contactData.numbers == null) return null; - List recipients = new ArrayList(); + Recipients recipients = new Recipients(new ArrayList()); for (ContactAccessor.NumberData numberData : contactData.numbers) { if (NumberUtil.isValidSmsOrEmailOrGroup(numberData.number)) { - Recipient recipient = RecipientFactory.getRecipientForNumber(SingleContactSelectionActivity.this, - numberData.number, - false); - recipients.add(recipient); + try { + Recipients recipientsForNumber = RecipientFactory.getRecipientsFromString(SingleContactSelectionActivity.this, + numberData.number, + false); + recipients.getRecipientsList().addAll(recipientsForNumber.getRecipientsList()); + } catch (RecipientFormattingException rfe) { } } } - return new Recipients(recipients); + return recipients; } private void openNewConversation(Recipients recipients) { diff --git a/src/org/thoughtcrime/securesms/recipients/RecipientFactory.java b/src/org/thoughtcrime/securesms/recipients/RecipientFactory.java index c591efb360..aac8f8a172 100644 --- a/src/org/thoughtcrime/securesms/recipients/RecipientFactory.java +++ b/src/org/thoughtcrime/securesms/recipients/RecipientFactory.java @@ -51,7 +51,7 @@ public class RecipientFactory { return new Recipients(results); } - public static Recipient getRecipientForNumber(Context context, String number, boolean asynchronous) { + private static Recipient getRecipientForNumber(Context context, String number, boolean asynchronous) { long recipientId = CanonicalAddressDatabase.getInstance(context).getCanonicalAddress(number); return provider.getRecipient(context, recipientId, asynchronous); }