Remove separators from names in recipient list

Fixes #1225 and #1174
This commit is contained in:
Buck Doyle 2014-03-25 11:11:20 -07:00
parent cab4a06974
commit bc143059f6

View file

@ -69,7 +69,7 @@ public class RecipientsPanel extends RelativeLayout {
}
public void addRecipient(String name, String number) {
if (name != null) recipientsText.append(name.replace(",", " ") + "< " + number + ">, ");
if (name != null) recipientsText.append(sanitizeRecipientName(name) + "< " + number + ">, ");
else recipientsText.append(number + ", ");
}
@ -149,6 +149,10 @@ public class RecipientsPanel extends RelativeLayout {
recipientsText.setOnFocusChangeListener(new FocusChangedListener());
}
private static String sanitizeRecipientName(String name) {
return name.replaceAll("[,<>]", "");
}
private class FocusChangedListener implements View.OnFocusChangeListener {
public void onFocusChange(View v, boolean hasFocus) {
if (!hasFocus && (panelChangeListener != null)) {