Add mentions for v2 group chats.

This commit is contained in:
Cody Henthorne
2020-08-05 16:45:52 -04:00
committed by Greyson Parrelli
parent 0bb9c1d650
commit b2d4c5d14b
90 changed files with 2279 additions and 372 deletions

View File

@@ -0,0 +1,20 @@
package org.thoughtcrime.securesms.keyvalue;
import androidx.annotation.NonNull;
public class NotificationSettings extends SignalStoreValues {
public static final String MENTIONS_NOTIFY_ME = "notifications.mentions.notify_me";
NotificationSettings(@NonNull KeyValueStore store) {
super(store);
}
@Override
void onFirstEverAppLaunch() {
}
public boolean isMentionNotifiesMeEnabled() {
return getBoolean(MENTIONS_NOTIFY_ME, true);
}
}

View File

@@ -1,7 +1,6 @@
package org.thoughtcrime.securesms.keyvalue;
import androidx.annotation.NonNull;
import androidx.lifecycle.OnLifecycleEvent;
import androidx.preference.PreferenceDataStore;
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
@@ -25,6 +24,7 @@ public final class SignalStore {
private final MiscellaneousValues misc;
private final InternalValues internalValues;
private final EmojiValues emojiValues;
private final NotificationSettings notificationSettings;
private SignalStore() {
this.store = ApplicationDependencies.getKeyValueStore();
@@ -38,6 +38,7 @@ public final class SignalStore {
this.misc = new MiscellaneousValues(store);
this.internalValues = new InternalValues(store);
this.emojiValues = new EmojiValues(store);
this.notificationSettings = new NotificationSettings(store);
}
public static void onFirstEverAppLaunch() {
@@ -50,6 +51,7 @@ public final class SignalStore {
tooltips().onFirstEverAppLaunch();
misc().onFirstEverAppLaunch();
internalValues().onFirstEverAppLaunch();
notificationSettings().onFirstEverAppLaunch();
}
public static @NonNull KbsValues kbsValues() {
@@ -92,6 +94,10 @@ public final class SignalStore {
return INSTANCE.emojiValues;
}
public static @NonNull NotificationSettings notificationSettings() {
return INSTANCE.notificationSettings;
}
public static @NonNull GroupsV2AuthorizationSignalStoreCache groupsV2AuthorizationCache() {
return new GroupsV2AuthorizationSignalStoreCache(getStore());
}