mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-24 19:00:26 +01:00
Renamed database classes to table classes.
Because they're not databases. They're tables.
This commit is contained in:
committed by
Cody Henthorne
parent
b190f9495a
commit
7949996c5c
@@ -11,7 +11,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.WorkerThread;
|
||||
|
||||
import org.signal.libsignal.protocol.util.Pair;
|
||||
import org.thoughtcrime.securesms.database.RecipientDatabase;
|
||||
import org.thoughtcrime.securesms.database.RecipientTable;
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase;
|
||||
import org.thoughtcrime.securesms.phonenumbers.PhoneNumberFormatter;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
@@ -32,8 +32,8 @@ import java.util.Map;
|
||||
*/
|
||||
public class ContactRepository {
|
||||
|
||||
private final RecipientDatabase recipientDatabase;
|
||||
private final String noteToSelfTitle;
|
||||
private final RecipientTable recipientTable;
|
||||
private final String noteToSelfTitle;
|
||||
private final Context context;
|
||||
|
||||
public static final String ID_COLUMN = "id";
|
||||
@@ -53,18 +53,18 @@ public class ContactRepository {
|
||||
|
||||
/** Maps the recipient results to the legacy contact column names */
|
||||
private static final List<Pair<String, ValueMapper>> SEARCH_CURSOR_MAPPERS = new ArrayList<Pair<String, ValueMapper>>() {{
|
||||
add(new Pair<>(ID_COLUMN, cursor -> CursorUtil.requireLong(cursor, RecipientDatabase.ID)));
|
||||
add(new Pair<>(ID_COLUMN, cursor -> CursorUtil.requireLong(cursor, RecipientTable.ID)));
|
||||
|
||||
add(new Pair<>(NAME_COLUMN, cursor -> {
|
||||
String system = CursorUtil.requireString(cursor, RecipientDatabase.SYSTEM_JOINED_NAME);
|
||||
String profile = CursorUtil.requireString(cursor, RecipientDatabase.SEARCH_PROFILE_NAME);
|
||||
String system = CursorUtil.requireString(cursor, RecipientTable.SYSTEM_JOINED_NAME);
|
||||
String profile = CursorUtil.requireString(cursor, RecipientTable.SEARCH_PROFILE_NAME);
|
||||
|
||||
return Util.getFirstNonEmpty(system, profile);
|
||||
}));
|
||||
|
||||
add(new Pair<>(NUMBER_COLUMN, cursor -> {
|
||||
String phone = CursorUtil.requireString(cursor, RecipientDatabase.PHONE);
|
||||
String email = CursorUtil.requireString(cursor, RecipientDatabase.EMAIL);
|
||||
String phone = CursorUtil.requireString(cursor, RecipientTable.PHONE);
|
||||
String email = CursorUtil.requireString(cursor, RecipientTable.EMAIL);
|
||||
|
||||
if (phone != null) {
|
||||
phone = PhoneNumberFormatter.prettyPrint(phone);
|
||||
@@ -73,18 +73,18 @@ public class ContactRepository {
|
||||
return Util.getFirstNonEmpty(phone, email);
|
||||
}));
|
||||
|
||||
add(new Pair<>(NUMBER_TYPE_COLUMN, cursor -> CursorUtil.requireInt(cursor, RecipientDatabase.SYSTEM_PHONE_TYPE)));
|
||||
add(new Pair<>(NUMBER_TYPE_COLUMN, cursor -> CursorUtil.requireInt(cursor, RecipientTable.SYSTEM_PHONE_TYPE)));
|
||||
|
||||
add(new Pair<>(LABEL_COLUMN, cursor -> CursorUtil.requireString(cursor, RecipientDatabase.SYSTEM_PHONE_LABEL)));
|
||||
add(new Pair<>(LABEL_COLUMN, cursor -> CursorUtil.requireString(cursor, RecipientTable.SYSTEM_PHONE_LABEL)));
|
||||
|
||||
add(new Pair<>(CONTACT_TYPE_COLUMN, cursor -> {
|
||||
int registered = CursorUtil.requireInt(cursor, RecipientDatabase.REGISTERED);
|
||||
return registered == RecipientDatabase.RegisteredState.REGISTERED.getId() ? PUSH_TYPE : NORMAL_TYPE;
|
||||
int registered = CursorUtil.requireInt(cursor, RecipientTable.REGISTERED);
|
||||
return registered == RecipientTable.RegisteredState.REGISTERED.getId() ? PUSH_TYPE : NORMAL_TYPE;
|
||||
}));
|
||||
|
||||
add(new Pair<>(ABOUT_COLUMN, cursor -> {
|
||||
String aboutEmoji = CursorUtil.requireString(cursor, RecipientDatabase.ABOUT_EMOJI);
|
||||
String about = CursorUtil.requireString(cursor, RecipientDatabase.ABOUT);
|
||||
String aboutEmoji = CursorUtil.requireString(cursor, RecipientTable.ABOUT_EMOJI);
|
||||
String about = CursorUtil.requireString(cursor, RecipientTable.ABOUT);
|
||||
|
||||
if (!Util.isEmpty(aboutEmoji)) {
|
||||
if (!Util.isEmpty(about)) {
|
||||
@@ -101,8 +101,8 @@ public class ContactRepository {
|
||||
}};
|
||||
|
||||
public ContactRepository(@NonNull Context context, @NonNull String noteToSelfTitle) {
|
||||
this.recipientDatabase = SignalDatabase.recipients();
|
||||
this.noteToSelfTitle = noteToSelfTitle;
|
||||
this.recipientTable = SignalDatabase.recipients();
|
||||
this.noteToSelfTitle = noteToSelfTitle;
|
||||
this.context = context.getApplicationContext();
|
||||
}
|
||||
|
||||
@@ -113,8 +113,8 @@ public class ContactRepository {
|
||||
|
||||
@WorkerThread
|
||||
public @NonNull Cursor querySignalContacts(@NonNull String query, boolean includeSelf) {
|
||||
Cursor cursor = TextUtils.isEmpty(query) ? recipientDatabase.getSignalContacts(includeSelf)
|
||||
: recipientDatabase.querySignalContacts(query, includeSelf);
|
||||
Cursor cursor = TextUtils.isEmpty(query) ? recipientTable.getSignalContacts(includeSelf)
|
||||
: recipientTable.querySignalContacts(query, includeSelf);
|
||||
|
||||
cursor = handleNoteToSelfQuery(query, includeSelf, cursor);
|
||||
|
||||
@@ -123,8 +123,8 @@ public class ContactRepository {
|
||||
|
||||
@WorkerThread
|
||||
public @NonNull Cursor queryNonGroupContacts(@NonNull String query, boolean includeSelf) {
|
||||
Cursor cursor = TextUtils.isEmpty(query) ? recipientDatabase.getNonGroupContacts(includeSelf)
|
||||
: recipientDatabase.queryNonGroupContacts(query, includeSelf);
|
||||
Cursor cursor = TextUtils.isEmpty(query) ? recipientTable.getNonGroupContacts(includeSelf)
|
||||
: recipientTable.queryNonGroupContacts(query, includeSelf);
|
||||
|
||||
cursor = handleNoteToSelfQuery(query, includeSelf, cursor);
|
||||
|
||||
@@ -139,8 +139,8 @@ public class ContactRepository {
|
||||
boolean shouldAdd = !nameMatch && !numberMatch;
|
||||
|
||||
if (shouldAdd) {
|
||||
MatrixCursor selfCursor = new MatrixCursor(RecipientDatabase.SEARCH_PROJECTION_NAMES);
|
||||
selfCursor.addRow(new Object[]{ self.getId().serialize(), noteToSelfTitle, self.getE164().orElse(""), self.getEmail().orElse(null), null, -1, RecipientDatabase.RegisteredState.REGISTERED.getId(), self.getAbout(), self.getAboutEmoji(), null, true, noteToSelfTitle, noteToSelfTitle });
|
||||
MatrixCursor selfCursor = new MatrixCursor(RecipientTable.SEARCH_PROJECTION_NAMES);
|
||||
selfCursor.addRow(new Object[]{ self.getId().serialize(), noteToSelfTitle, self.getE164().orElse(""), self.getEmail().orElse(null), null, -1, RecipientTable.RegisteredState.REGISTERED.getId(), self.getAbout(), self.getAboutEmoji(), null, true, noteToSelfTitle, noteToSelfTitle });
|
||||
|
||||
cursor = cursor == null ? selfCursor : new MergeCursor(new Cursor[]{ cursor, selfCursor });
|
||||
}
|
||||
@@ -150,8 +150,8 @@ public class ContactRepository {
|
||||
|
||||
@WorkerThread
|
||||
public Cursor queryNonSignalContacts(@NonNull String query) {
|
||||
Cursor cursor = TextUtils.isEmpty(query) ? recipientDatabase.getNonSignalContacts()
|
||||
: recipientDatabase.queryNonSignalContacts(query);
|
||||
Cursor cursor = TextUtils.isEmpty(query) ? recipientTable.getNonSignalContacts()
|
||||
: recipientTable.queryNonSignalContacts(query);
|
||||
return new SearchCursorWrapper(cursor, SEARCH_CURSOR_MAPPERS);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,10 +25,10 @@ import androidx.annotation.NonNull;
|
||||
import org.signal.core.util.CursorUtil;
|
||||
import org.signal.core.util.logging.Log;
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.database.GroupDatabase;
|
||||
import org.thoughtcrime.securesms.database.RecipientDatabase;
|
||||
import org.thoughtcrime.securesms.database.GroupTable;
|
||||
import org.thoughtcrime.securesms.database.RecipientTable;
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase;
|
||||
import org.thoughtcrime.securesms.database.ThreadDatabase;
|
||||
import org.thoughtcrime.securesms.database.ThreadTable;
|
||||
import org.thoughtcrime.securesms.database.model.ThreadRecord;
|
||||
import org.thoughtcrime.securesms.phonenumbers.NumberUtil;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
@@ -193,12 +193,12 @@ public class ContactsCursorLoader extends AbstractContactsCursorLoader {
|
||||
}
|
||||
|
||||
private Cursor getRecentConversationsCursor(boolean groupsOnly) {
|
||||
ThreadDatabase threadDatabase = SignalDatabase.threads();
|
||||
ThreadTable threadTable = SignalDatabase.threads();
|
||||
|
||||
MatrixCursor recentConversations = ContactsCursorRows.createMatrixCursor(RECENT_CONVERSATION_MAX);
|
||||
try (Cursor rawConversations = threadDatabase.getRecentConversationList(RECENT_CONVERSATION_MAX, flagSet(mode, DisplayMode.FLAG_INACTIVE_GROUPS), false, groupsOnly, hideGroupsV1(mode), !smsEnabled(mode), false)) {
|
||||
ThreadDatabase.Reader reader = threadDatabase.readerFor(rawConversations);
|
||||
ThreadRecord threadRecord;
|
||||
try (Cursor rawConversations = threadTable.getRecentConversationList(RECENT_CONVERSATION_MAX, flagSet(mode, DisplayMode.FLAG_INACTIVE_GROUPS), false, groupsOnly, hideGroupsV1(mode), !smsEnabled(mode), false)) {
|
||||
ThreadTable.Reader reader = threadTable.readerFor(rawConversations);
|
||||
ThreadRecord threadRecord;
|
||||
while ((threadRecord = reader.getNext()) != null) {
|
||||
recentConversations.addRow(ContactsCursorRows.forRecipient(getContext(), threadRecord.getRecipient()));
|
||||
}
|
||||
@@ -221,11 +221,11 @@ public class ContactsCursorLoader extends AbstractContactsCursorLoader {
|
||||
}
|
||||
|
||||
private Cursor getGroupsCursor() {
|
||||
MatrixCursor groupContacts = ContactsCursorRows.createMatrixCursor();
|
||||
Map<RecipientId, GroupDatabase.GroupRecord> groups = new LinkedHashMap<>();
|
||||
MatrixCursor groupContacts = ContactsCursorRows.createMatrixCursor();
|
||||
Map<RecipientId, GroupTable.GroupRecord> groups = new LinkedHashMap<>();
|
||||
|
||||
try (GroupDatabase.Reader reader = SignalDatabase.groups().queryGroupsByTitle(getFilter(), flagSet(mode, DisplayMode.FLAG_INACTIVE_GROUPS), hideGroupsV1(mode), !smsEnabled(mode))) {
|
||||
GroupDatabase.GroupRecord groupRecord;
|
||||
try (GroupTable.Reader reader = SignalDatabase.groups().queryGroupsByTitle(getFilter(), flagSet(mode, DisplayMode.FLAG_INACTIVE_GROUPS), hideGroupsV1(mode), !smsEnabled(mode))) {
|
||||
GroupTable.GroupRecord groupRecord;
|
||||
while ((groupRecord = reader.getNext()) != null) {
|
||||
groups.put(groupRecord.getRecipientId(), groupRecord);
|
||||
}
|
||||
@@ -235,19 +235,19 @@ public class ContactsCursorLoader extends AbstractContactsCursorLoader {
|
||||
Set<RecipientId> filteredContacts = new HashSet<>();
|
||||
try (Cursor cursor = SignalDatabase.recipients().queryAllContacts(getFilter())) {
|
||||
while (cursor != null && cursor.moveToNext()) {
|
||||
filteredContacts.add(RecipientId.from(CursorUtil.requireString(cursor, RecipientDatabase.ID)));
|
||||
filteredContacts.add(RecipientId.from(CursorUtil.requireString(cursor, RecipientTable.ID)));
|
||||
}
|
||||
}
|
||||
|
||||
try (GroupDatabase.Reader reader = SignalDatabase.groups().queryGroupsByMembership(filteredContacts, flagSet(mode, DisplayMode.FLAG_INACTIVE_GROUPS), hideGroupsV1(mode), !smsEnabled(mode))) {
|
||||
GroupDatabase.GroupRecord groupRecord;
|
||||
try (GroupTable.Reader reader = SignalDatabase.groups().queryGroupsByMembership(filteredContacts, flagSet(mode, DisplayMode.FLAG_INACTIVE_GROUPS), hideGroupsV1(mode), !smsEnabled(mode))) {
|
||||
GroupTable.GroupRecord groupRecord;
|
||||
while ((groupRecord = reader.getNext()) != null) {
|
||||
groups.put(groupRecord.getRecipientId(), groupRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (GroupDatabase.GroupRecord groupRecord : groups.values()) {
|
||||
for (GroupTable.GroupRecord groupRecord : groups.values()) {
|
||||
groupContacts.addRow(ContactsCursorRows.forGroup(groupRecord));
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import android.provider.ContactsContract;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.database.GroupDatabase;
|
||||
import org.thoughtcrime.securesms.database.GroupTable;
|
||||
import org.thoughtcrime.securesms.phonenumbers.PhoneNumberFormatter;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.whispersystems.signalservice.api.util.OptionalUtil;
|
||||
@@ -74,7 +74,7 @@ public final class ContactsCursorRows {
|
||||
/**
|
||||
* Create a row for a contacts cursor based off the given group record.
|
||||
*/
|
||||
public static @NonNull Object[] forGroup(@NonNull GroupDatabase.GroupRecord groupRecord) {
|
||||
public static @NonNull Object[] forGroup(@NonNull GroupTable.GroupRecord groupRecord) {
|
||||
return new Object[]{groupRecord.getRecipientId().serialize(),
|
||||
groupRecord.getTitle(),
|
||||
groupRecord.getId(),
|
||||
|
||||
@@ -9,9 +9,9 @@ import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.database.MessageDatabase;
|
||||
import org.thoughtcrime.securesms.database.MessageTable;
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase;
|
||||
import org.thoughtcrime.securesms.database.ThreadDatabase;
|
||||
import org.thoughtcrime.securesms.database.ThreadTable;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.notifications.MarkReadReceiver;
|
||||
@@ -52,9 +52,9 @@ public class TurnOffContactJoinedNotificationsActivity extends AppCompatActivity
|
||||
|
||||
private void handlePositiveAction(@NonNull DialogInterface dialog) {
|
||||
SimpleTask.run(getLifecycle(), () -> {
|
||||
ThreadDatabase threadDatabase = SignalDatabase.threads();
|
||||
ThreadTable threadTable = SignalDatabase.threads();
|
||||
|
||||
List<MessageDatabase.MarkedMessageInfo> marked = threadDatabase.setRead(getIntent().getLongExtra(EXTRA_THREAD_ID, -1), false);
|
||||
List<MessageTable.MarkedMessageInfo> marked = threadTable.setRead(getIntent().getLongExtra(EXTRA_THREAD_ID, -1), false);
|
||||
MarkReadReceiver.process(this, marked);
|
||||
|
||||
SignalStore.settings().setNotifyWhenContactJoinsSignal(false);
|
||||
|
||||
@@ -8,7 +8,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import org.signal.core.util.Conversions;
|
||||
import org.thoughtcrime.securesms.database.GroupDatabase;
|
||||
import org.thoughtcrime.securesms.database.GroupTable;
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase;
|
||||
import org.thoughtcrime.securesms.groups.GroupId;
|
||||
import org.thoughtcrime.securesms.profiles.AvatarHelper;
|
||||
@@ -30,8 +30,8 @@ public final class GroupRecordContactPhoto implements ContactPhoto {
|
||||
|
||||
@Override
|
||||
public InputStream openInputStream(Context context) throws IOException {
|
||||
GroupDatabase groupDatabase = SignalDatabase.groups();
|
||||
Optional<GroupDatabase.GroupRecord> groupRecord = groupDatabase.getGroup(groupId);
|
||||
GroupTable groupDatabase = SignalDatabase.groups();
|
||||
Optional<GroupTable.GroupRecord> groupRecord = groupDatabase.getGroup(groupId);
|
||||
|
||||
if (!groupRecord.isPresent() || !AvatarHelper.hasAvatar(context, groupRecord.get().getRecipientId())) {
|
||||
throw new IOException("No avatar for group: " + groupId);
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.thoughtcrime.securesms.contacts.paged.collections.ContactSearchCollec
|
||||
import org.thoughtcrime.securesms.contacts.paged.collections.ContactSearchIterator
|
||||
import org.thoughtcrime.securesms.contacts.paged.collections.CursorSearchIterator
|
||||
import org.thoughtcrime.securesms.contacts.paged.collections.StoriesSearchCollection
|
||||
import org.thoughtcrime.securesms.database.GroupDatabase.GroupRecord
|
||||
import org.thoughtcrime.securesms.database.GroupTable.GroupRecord
|
||||
import org.thoughtcrime.securesms.database.model.DistributionListPrivacyMode
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies
|
||||
import org.thoughtcrime.securesms.keyvalue.StorySend
|
||||
|
||||
@@ -6,11 +6,11 @@ import org.signal.core.util.CursorUtil
|
||||
import org.thoughtcrime.securesms.R
|
||||
import org.thoughtcrime.securesms.contacts.ContactRepository
|
||||
import org.thoughtcrime.securesms.contacts.paged.collections.ContactSearchIterator
|
||||
import org.thoughtcrime.securesms.database.DistributionListDatabase
|
||||
import org.thoughtcrime.securesms.database.GroupDatabase
|
||||
import org.thoughtcrime.securesms.database.GroupDatabase.GroupRecord
|
||||
import org.thoughtcrime.securesms.database.DistributionListTables
|
||||
import org.thoughtcrime.securesms.database.GroupTable
|
||||
import org.thoughtcrime.securesms.database.GroupTable.GroupRecord
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase
|
||||
import org.thoughtcrime.securesms.database.ThreadDatabase
|
||||
import org.thoughtcrime.securesms.database.ThreadTable
|
||||
import org.thoughtcrime.securesms.database.model.DistributionListPrivacyMode
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore
|
||||
import org.thoughtcrime.securesms.keyvalue.StorySend
|
||||
@@ -53,7 +53,7 @@ open class ContactSearchPagedDataSourceRepository(
|
||||
query: String?
|
||||
): ContactSearchIterator<GroupRecord> {
|
||||
return SignalDatabase.groups.queryGroups(
|
||||
GroupDatabase.GroupQuery.Builder()
|
||||
GroupTable.GroupQuery.Builder()
|
||||
.withSearchQuery(query)
|
||||
.withInactiveGroups(section.includeInactive)
|
||||
.withMmsGroups(section.includeMms)
|
||||
@@ -80,15 +80,15 @@ open class ContactSearchPagedDataSourceRepository(
|
||||
}
|
||||
|
||||
open fun getRecipientFromDistributionListCursor(cursor: Cursor): Recipient {
|
||||
return Recipient.resolved(RecipientId.from(CursorUtil.requireLong(cursor, DistributionListDatabase.RECIPIENT_ID)))
|
||||
return Recipient.resolved(RecipientId.from(CursorUtil.requireLong(cursor, DistributionListTables.RECIPIENT_ID)))
|
||||
}
|
||||
|
||||
open fun getPrivacyModeFromDistributionListCursor(cursor: Cursor): DistributionListPrivacyMode {
|
||||
return DistributionListPrivacyMode.deserialize(CursorUtil.requireLong(cursor, DistributionListDatabase.PRIVACY_MODE))
|
||||
return DistributionListPrivacyMode.deserialize(CursorUtil.requireLong(cursor, DistributionListTables.PRIVACY_MODE))
|
||||
}
|
||||
|
||||
open fun getRecipientFromThreadCursor(cursor: Cursor): Recipient {
|
||||
return Recipient.resolved(RecipientId.from(CursorUtil.requireLong(cursor, ThreadDatabase.RECIPIENT_ID)))
|
||||
return Recipient.resolved(RecipientId.from(CursorUtil.requireLong(cursor, ThreadTable.RECIPIENT_ID)))
|
||||
}
|
||||
|
||||
open fun getRecipientFromRecipientCursor(cursor: Cursor): Recipient {
|
||||
|
||||
@@ -4,7 +4,7 @@ import androidx.annotation.CheckResult
|
||||
import io.reactivex.rxjava3.core.Completable
|
||||
import io.reactivex.rxjava3.core.Single
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
import org.thoughtcrime.securesms.database.GroupDatabase
|
||||
import org.thoughtcrime.securesms.database.GroupTable
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase
|
||||
import org.thoughtcrime.securesms.database.model.DistributionListId
|
||||
import org.thoughtcrime.securesms.groups.GroupId
|
||||
@@ -42,7 +42,7 @@ class ContactSearchRepository {
|
||||
@CheckResult
|
||||
fun markDisplayAsStory(recipientIds: Collection<RecipientId>): Completable {
|
||||
return Completable.fromAction {
|
||||
SignalDatabase.groups.setShowAsStoryState(recipientIds, GroupDatabase.ShowAsStoryState.ALWAYS)
|
||||
SignalDatabase.groups.setShowAsStoryState(recipientIds, GroupTable.ShowAsStoryState.ALWAYS)
|
||||
SignalDatabase.recipients.markNeedsSync(recipientIds)
|
||||
StorageSyncHelper.scheduleSyncForDataChange()
|
||||
}.subscribeOn(Schedulers.io())
|
||||
@@ -51,7 +51,7 @@ class ContactSearchRepository {
|
||||
@CheckResult
|
||||
fun unmarkDisplayAsStory(groupId: GroupId): Completable {
|
||||
return Completable.fromAction {
|
||||
SignalDatabase.groups.setShowAsStoryState(groupId, GroupDatabase.ShowAsStoryState.NEVER)
|
||||
SignalDatabase.groups.setShowAsStoryState(groupId, GroupTable.ShowAsStoryState.NEVER)
|
||||
SignalDatabase.recipients.markNeedsSync(Recipient.externalGroupExact(groupId).id)
|
||||
StorageSyncHelper.scheduleSyncForDataChange()
|
||||
}.subscribeOn(Schedulers.io())
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.signal.contacts.SystemContactsRepository.ContactPhoneDetails
|
||||
import org.signal.core.util.Stopwatch
|
||||
import org.signal.core.util.StringUtil
|
||||
import org.signal.core.util.logging.Log
|
||||
import org.thoughtcrime.securesms.database.RecipientDatabase
|
||||
import org.thoughtcrime.securesms.database.RecipientTable
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies
|
||||
import org.thoughtcrime.securesms.jobs.SyncSystemContactLinksJob
|
||||
@@ -93,7 +93,7 @@ object ContactDiscovery {
|
||||
@JvmStatic
|
||||
@Throws(IOException::class)
|
||||
@WorkerThread
|
||||
fun refresh(context: Context, recipient: Recipient, notifyOfNewUsers: Boolean): RecipientDatabase.RegisteredState {
|
||||
fun refresh(context: Context, recipient: Recipient, notifyOfNewUsers: Boolean): RecipientTable.RegisteredState {
|
||||
val result: RefreshResult = refreshRecipients(
|
||||
context = context,
|
||||
descriptor = "refresh-single",
|
||||
@@ -105,9 +105,9 @@ object ContactDiscovery {
|
||||
)
|
||||
|
||||
return if (result.registeredIds.contains(recipient.id)) {
|
||||
RecipientDatabase.RegisteredState.REGISTERED
|
||||
RecipientTable.RegisteredState.REGISTERED
|
||||
} else {
|
||||
RecipientDatabase.RegisteredState.NOT_REGISTERED
|
||||
RecipientTable.RegisteredState.NOT_REGISTERED
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.signal.core.util.logging.Log
|
||||
import org.thoughtcrime.securesms.BuildConfig
|
||||
import org.thoughtcrime.securesms.contacts.sync.FuzzyPhoneNumberHelper.InputResult
|
||||
import org.thoughtcrime.securesms.contacts.sync.FuzzyPhoneNumberHelper.OutputResult
|
||||
import org.thoughtcrime.securesms.database.RecipientDatabase.CdsV2Result
|
||||
import org.thoughtcrime.securesms.database.RecipientTable.CdsV2Result
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies
|
||||
import org.thoughtcrime.securesms.jobs.RetrieveProfileJob
|
||||
|
||||
Reference in New Issue
Block a user