mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-25 12:38:39 +00:00
Refactor "parts" to contain MMS/PDU madness to MMS code paths.
Closes #4248 // FREEBIE
This commit is contained in:
@@ -81,6 +81,20 @@ public class RecipientFactory {
|
||||
return getRecipientsForIds(context, ids, asynchronous);
|
||||
}
|
||||
|
||||
public static Recipients getRecipientsFromStrings(@NonNull Context context, @NonNull List<String> numbers, boolean asynchronous) {
|
||||
List<String> ids = new LinkedList<>();
|
||||
|
||||
for (String number : numbers) {
|
||||
Optional<Long> id = getRecipientIdFromNumber(context, number);
|
||||
|
||||
if (id.isPresent()) {
|
||||
ids.add(String.valueOf(id.get()));
|
||||
}
|
||||
}
|
||||
|
||||
return getRecipientsForIds(context, ids, asynchronous);
|
||||
}
|
||||
|
||||
private static Recipients getRecipientsForIds(Context context, List<String> idStrings, boolean asynchronous) {
|
||||
long[] ids = new long[idStrings.size()];
|
||||
int i = 0;
|
||||
|
||||
@@ -257,7 +257,7 @@ public class Recipients implements Iterable<Recipient>, RecipientModifiedListene
|
||||
return Util.join(recipientArray, " ");
|
||||
}
|
||||
|
||||
public String[] toNumberStringArray(boolean scrub) {
|
||||
public @NonNull String[] toNumberStringArray(boolean scrub) {
|
||||
String[] recipientsArray = new String[recipients.size()];
|
||||
Iterator<Recipient> iterator = recipients.iterator();
|
||||
int i = 0;
|
||||
@@ -278,6 +278,13 @@ public class Recipients implements Iterable<Recipient>, RecipientModifiedListene
|
||||
return recipientsArray;
|
||||
}
|
||||
|
||||
public @NonNull List<String> toNumberStringList(boolean scrub) {
|
||||
List<String> results = new LinkedList<>();
|
||||
Collections.addAll(results, toNumberStringArray(scrub));
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
public String toShortString() {
|
||||
String fromString = "";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user