mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Convert MiscellaneousValues to kotlin.
This commit is contained in:
committed by
Cody Henthorne
parent
e6a11c1ccf
commit
e24c951d83
@@ -148,7 +148,7 @@ public class EditSelfProfileRepository implements EditProfileRepository {
|
||||
RegistrationUtil.maybeMarkRegistrationComplete();
|
||||
|
||||
if (avatar != null) {
|
||||
SignalStore.misc().markHasEverHadAnAvatar();
|
||||
SignalStore.misc().setHasEverHadAnAvatar(true);
|
||||
}
|
||||
|
||||
return UploadResult.SUCCESS;
|
||||
|
||||
@@ -59,7 +59,7 @@ final class EditProfileRepository {
|
||||
try {
|
||||
ProfileUtil.uploadProfileWithAvatar(new StreamDetails(new ByteArrayInputStream(data), contentType, data.length));
|
||||
AvatarHelper.setAvatar(context, Recipient.self().getId(), new ByteArrayInputStream(data));
|
||||
SignalStore.misc().markHasEverHadAnAvatar();
|
||||
SignalStore.misc().setHasEverHadAnAvatar(true);
|
||||
ApplicationDependencies.getJobManager().add(new MultiDeviceProfileContentUpdateJob());
|
||||
|
||||
callback.accept(Result.SUCCESS);
|
||||
|
||||
@@ -130,7 +130,7 @@ object UsernameRepository {
|
||||
@WorkerThread
|
||||
@JvmStatic
|
||||
fun reclaimUsernameIfNecessary(): UsernameReclaimResult {
|
||||
if (!SignalStore.misc().needsUsernameRestore()) {
|
||||
if (!SignalStore.misc().needsUsernameRestore) {
|
||||
Log.d(TAG, "[reclaimUsernameIfNecessary] No need to restore username. Skipping.")
|
||||
return UsernameReclaimResult.SUCCESS
|
||||
}
|
||||
@@ -140,7 +140,7 @@ object UsernameRepository {
|
||||
|
||||
if (username == null || link == null) {
|
||||
Log.d(TAG, "[reclaimUsernameIfNecessary] No username or link to restore. Skipping.")
|
||||
SignalStore.misc().setNeedsUsernameRestore(false)
|
||||
SignalStore.misc().needsUsernameRestore = false
|
||||
return UsernameReclaimResult.SUCCESS
|
||||
}
|
||||
|
||||
@@ -149,13 +149,13 @@ object UsernameRepository {
|
||||
when (result) {
|
||||
UsernameReclaimResult.SUCCESS -> {
|
||||
Log.i(TAG, "[reclaimUsernameIfNecessary] Successfully reclaimed username and link.")
|
||||
SignalStore.misc().setNeedsUsernameRestore(false)
|
||||
SignalStore.misc().needsUsernameRestore = false
|
||||
}
|
||||
|
||||
UsernameReclaimResult.PERMANENT_ERROR -> {
|
||||
Log.w(TAG, "[reclaimUsernameIfNecessary] Permanently failed to reclaim username and link. User will see an error.")
|
||||
SignalStore.account().usernameSyncState = AccountValues.UsernameSyncState.USERNAME_AND_LINK_CORRUPTED
|
||||
SignalStore.misc().setNeedsUsernameRestore(false)
|
||||
SignalStore.misc().needsUsernameRestore = false
|
||||
}
|
||||
|
||||
UsernameReclaimResult.NETWORK_ERROR -> {
|
||||
|
||||
Reference in New Issue
Block a user