mirror of
https://github.com/oxen-io/session-android.git
synced 2025-04-20 07:41:31 +00:00
parent
cab4a06974
commit
bc143059f6
@ -69,7 +69,7 @@ public class RecipientsPanel extends RelativeLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addRecipient(String name, String number) {
|
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 + ", ");
|
else recipientsText.append(number + ", ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,6 +149,10 @@ public class RecipientsPanel extends RelativeLayout {
|
|||||||
recipientsText.setOnFocusChangeListener(new FocusChangedListener());
|
recipientsText.setOnFocusChangeListener(new FocusChangedListener());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String sanitizeRecipientName(String name) {
|
||||||
|
return name.replaceAll("[,<>]", "");
|
||||||
|
}
|
||||||
|
|
||||||
private class FocusChangedListener implements View.OnFocusChangeListener {
|
private class FocusChangedListener implements View.OnFocusChangeListener {
|
||||||
public void onFocusChange(View v, boolean hasFocus) {
|
public void onFocusChange(View v, boolean hasFocus) {
|
||||||
if (!hasFocus && (panelChangeListener != null)) {
|
if (!hasFocus && (panelChangeListener != null)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user