mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-08 22:28:33 +00:00
Fix false group name and avatar updates.
This commit is contained in:
parent
8dbc721c08
commit
dc9370c32b
@ -16,6 +16,7 @@ import org.thoughtcrime.securesms.util.StringUtil;
|
|||||||
import org.thoughtcrime.securesms.util.livedata.LiveDataUtil;
|
import org.thoughtcrime.securesms.util.livedata.LiveDataUtil;
|
||||||
import org.whispersystems.libsignal.util.guava.Optional;
|
import org.whispersystems.libsignal.util.guava.Optional;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
class EditProfileViewModel extends ViewModel {
|
class EditProfileViewModel extends ViewModel {
|
||||||
@ -121,9 +122,9 @@ class EditProfileViewModel extends ViewModel {
|
|||||||
|
|
||||||
repository.uploadProfile(profileName,
|
repository.uploadProfile(profileName,
|
||||||
displayName,
|
displayName,
|
||||||
!Objects.equals(oldDisplayName, displayName),
|
!Objects.equals(StringUtil.stripBidiProtection(oldDisplayName), displayName),
|
||||||
newAvatar,
|
newAvatar,
|
||||||
oldAvatar != newAvatar,
|
!Arrays.equals(oldAvatar, newAvatar),
|
||||||
uploadResultConsumer);
|
uploadResultConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,6 +181,12 @@ public final class StringUtil {
|
|||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static @Nullable String stripBidiProtection(@Nullable String text) {
|
||||||
|
if (text == null) return null;
|
||||||
|
|
||||||
|
return text.replaceAll("[\\u2068\\u2069\\u202c]", "");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Trims a {@link CharSequence} of starting and trailing whitespace. Behavior matches
|
* Trims a {@link CharSequence} of starting and trailing whitespace. Behavior matches
|
||||||
* {@link String#trim()} to preserve expectations around results.
|
* {@link String#trim()} to preserve expectations around results.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user