2020-06-12 19:22:46 +02:00
|
|
|
package org.thoughtcrime.securesms.keyvalue;
|
|
|
|
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
|
|
|
|
public final class MiscellaneousValues extends SignalStoreValues {
|
|
|
|
|
|
|
|
private static final String LAST_PREKEY_REFRESH_TIME = "last_prekey_refresh_time";
|
|
|
|
private static final String MESSAGE_REQUEST_ENABLE_TIME = "message_request_enable_time";
|
|
|
|
private static final String LAST_PROFILE_REFRESH_TIME = "misc.last_profile_refresh_time";
|
2020-08-27 15:49:45 +02:00
|
|
|
private static final String USERNAME_SHOW_REMINDER = "username.show.reminder";
|
2020-09-09 00:03:56 +02:00
|
|
|
private static final String CLIENT_DEPRECATED = "misc.client_deprecated";
|
2020-06-12 19:22:46 +02:00
|
|
|
|
|
|
|
MiscellaneousValues(@NonNull KeyValueStore store) {
|
|
|
|
super(store);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
void onFirstEverAppLaunch() {
|
2020-10-12 16:09:35 +02:00
|
|
|
putLong(MESSAGE_REQUEST_ENABLE_TIME, 0);
|
2020-06-12 19:22:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public long getLastPrekeyRefreshTime() {
|
|
|
|
return getLong(LAST_PREKEY_REFRESH_TIME, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setLastPrekeyRefreshTime(long time) {
|
|
|
|
putLong(LAST_PREKEY_REFRESH_TIME, time);
|
|
|
|
}
|
|
|
|
|
|
|
|
public long getMessageRequestEnableTime() {
|
2020-10-12 16:09:35 +02:00
|
|
|
return getLong(MESSAGE_REQUEST_ENABLE_TIME, 0);
|
2020-06-12 19:22:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public long getLastProfileRefreshTime() {
|
|
|
|
return getLong(LAST_PROFILE_REFRESH_TIME, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setLastProfileRefreshTime(long time) {
|
|
|
|
putLong(LAST_PROFILE_REFRESH_TIME, time);
|
|
|
|
}
|
2020-08-27 15:49:45 +02:00
|
|
|
|
|
|
|
public void hideUsernameReminder() {
|
|
|
|
putBoolean(USERNAME_SHOW_REMINDER, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean shouldShowUsernameReminder() {
|
|
|
|
return getBoolean(USERNAME_SHOW_REMINDER, true);
|
|
|
|
}
|
2020-09-09 00:03:56 +02:00
|
|
|
|
|
|
|
public boolean isClientDeprecated() {
|
|
|
|
return getBoolean(CLIENT_DEPRECATED, false);
|
|
|
|
}
|
|
|
|
|
2020-09-09 16:22:22 +02:00
|
|
|
public void markClientDeprecated() {
|
2020-09-09 00:03:56 +02:00
|
|
|
putBoolean(CLIENT_DEPRECATED, true);
|
|
|
|
}
|
2020-09-09 16:22:22 +02:00
|
|
|
|
|
|
|
public void clearClientDeprecated() {
|
|
|
|
putBoolean(CLIENT_DEPRECATED, false);
|
|
|
|
}
|
2020-06-12 19:22:46 +02:00
|
|
|
}
|