public GroupMembers(Recipients recipients) { for (Recipient recipient : recipients.getRecipientsList()) { if (isLocalNumber(recipient)) { members.push(recipient); } else { members.add(recipient); } } }
private List<PushAddress> getPushAddresses(Recipients recipients) throws InvalidNumberException { List<PushAddress> addresses = new LinkedList<>(); for (Recipient recipient : recipients.getRecipientsList()) { addresses.add(getPushAddress(recipient)); } return addresses; }
private void setRecipientsTitle(Recipients recipients) { int size = recipients.getRecipientsList().size(); title.setText(getContext().getString(R.string.ConversationActivity_group_conversation)); subtitle.setText( (size == 1) ? getContext().getString(R.string.ConversationActivity_d_recipients_in_group_singular) : String.format( getContext().getString(R.string.ConversationActivity_d_recipients_in_group), size)); subtitle.setVisibility(View.VISIBLE); }
private long[] getRecipientIds(Recipients recipients) { Set<Long> recipientSet = new HashSet<>(); List<Recipient> recipientList = recipients.getRecipientsList(); for (Recipient recipient : recipientList) { recipientSet.add(recipient.getRecipientId()); } long[] recipientArray = new long[recipientSet.size()]; int i = 0; for (Long recipientId : recipientSet) { recipientArray[i++] = recipientId; } Arrays.sort(recipientArray); return recipientArray; }