mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-25 19:47:31 +00:00

committed by
Alan Evans

parent
dbf78d1b69
commit
ccd405fdce
@@ -441,7 +441,7 @@ public class Recipient {
|
||||
String name = getName(context);
|
||||
|
||||
if (Util.isEmpty(name)) {
|
||||
name = getProfileName().toString();
|
||||
name = StringUtil.isolateBidi(getProfileName().toString());
|
||||
}
|
||||
|
||||
if (Util.isEmpty(name) && !Util.isEmpty(e164)) {
|
||||
@@ -449,25 +449,27 @@ public class Recipient {
|
||||
}
|
||||
|
||||
if (Util.isEmpty(name)) {
|
||||
name = email;
|
||||
name = StringUtil.isolateBidi(email);
|
||||
}
|
||||
|
||||
if (Util.isEmpty(name)) {
|
||||
name = username;
|
||||
name = StringUtil.isolateBidi(username);
|
||||
}
|
||||
|
||||
if (Util.isEmpty(name)) {
|
||||
name = context.getString(R.string.Recipient_unknown);
|
||||
name = StringUtil.isolateBidi(context.getString(R.string.Recipient_unknown));
|
||||
}
|
||||
|
||||
return StringUtil.isolateBidi(name);
|
||||
return name;
|
||||
}
|
||||
|
||||
public @NonNull String getMentionDisplayName(@NonNull Context context) {
|
||||
String name = isSelf ? getProfileName().toString() : getName(context);
|
||||
name = StringUtil.isolateBidi(name);
|
||||
|
||||
if (Util.isEmpty(name)) {
|
||||
name = isSelf ? getName(context) : getProfileName().toString();
|
||||
name = StringUtil.isolateBidi(name);
|
||||
}
|
||||
|
||||
if (Util.isEmpty(name) && !Util.isEmpty(e164)) {
|
||||
@@ -475,14 +477,14 @@ public class Recipient {
|
||||
}
|
||||
|
||||
if (Util.isEmpty(name)) {
|
||||
name = email;
|
||||
name = StringUtil.isolateBidi(email);
|
||||
}
|
||||
|
||||
if (Util.isEmpty(name)) {
|
||||
name = context.getString(R.string.Recipient_unknown);
|
||||
name = StringUtil.isolateBidi(context.getString(R.string.Recipient_unknown));
|
||||
}
|
||||
|
||||
return StringUtil.isolateBidi(name);
|
||||
return name;
|
||||
}
|
||||
|
||||
public @NonNull String getShortDisplayName(@NonNull Context context) {
|
||||
|
@@ -160,8 +160,12 @@ public final class StringUtil {
|
||||
* For more details, see:
|
||||
* https://www.w3.org/International/questions/qa-bidi-unicode-controls
|
||||
*/
|
||||
public static @NonNull String isolateBidi(@NonNull String text) {
|
||||
if (text.isEmpty()) {
|
||||
public static @NonNull String isolateBidi(@Nullable String text) {
|
||||
if (text == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (Util.isEmpty(text)) {
|
||||
return text;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user