mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-26 03:11:36 +00:00
Rename RecipientPreferencesDatabase -> RecipientDatabase
// FREEBIE
This commit is contained in:
@@ -126,7 +126,7 @@ public class DatabaseFactory {
|
||||
private final DraftDatabase draftDatabase;
|
||||
private final PushDatabase pushDatabase;
|
||||
private final GroupDatabase groupDatabase;
|
||||
private final RecipientPreferenceDatabase recipientPreferenceDatabase;
|
||||
private final RecipientDatabase recipientDatabase;
|
||||
private final ContactsDatabase contactsDatabase;
|
||||
|
||||
public static DatabaseFactory getInstance(Context context) {
|
||||
@@ -182,8 +182,8 @@ public class DatabaseFactory {
|
||||
return getInstance(context).groupDatabase;
|
||||
}
|
||||
|
||||
public static RecipientPreferenceDatabase getRecipientPreferenceDatabase(Context context) {
|
||||
return getInstance(context).recipientPreferenceDatabase;
|
||||
public static RecipientDatabase getRecipientPreferenceDatabase(Context context) {
|
||||
return getInstance(context).recipientDatabase;
|
||||
}
|
||||
|
||||
public static ContactsDatabase getContactsDatabase(Context context) {
|
||||
@@ -203,7 +203,7 @@ public class DatabaseFactory {
|
||||
this.draftDatabase = new DraftDatabase(context, databaseHelper);
|
||||
this.pushDatabase = new PushDatabase(context, databaseHelper);
|
||||
this.groupDatabase = new GroupDatabase(context, databaseHelper);
|
||||
this.recipientPreferenceDatabase = new RecipientPreferenceDatabase(context, databaseHelper);
|
||||
this.recipientDatabase = new RecipientDatabase(context, databaseHelper);
|
||||
this.contactsDatabase = new ContactsDatabase(context);
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ public class DatabaseFactory {
|
||||
this.draftDatabase.reset(databaseHelper);
|
||||
this.pushDatabase.reset(databaseHelper);
|
||||
this.groupDatabase.reset(databaseHelper);
|
||||
this.recipientPreferenceDatabase.reset(databaseHelper);
|
||||
this.recipientDatabase.reset(databaseHelper);
|
||||
old.close();
|
||||
}
|
||||
|
||||
@@ -534,7 +534,7 @@ public class DatabaseFactory {
|
||||
db.execSQL(DraftDatabase.CREATE_TABLE);
|
||||
db.execSQL(PushDatabase.CREATE_TABLE);
|
||||
db.execSQL(GroupDatabase.CREATE_TABLE);
|
||||
db.execSQL(RecipientPreferenceDatabase.CREATE_TABLE);
|
||||
db.execSQL(RecipientDatabase.CREATE_TABLE);
|
||||
|
||||
executeStatements(db, SmsDatabase.CREATE_INDEXS);
|
||||
executeStatements(db, MmsDatabase.CREATE_INDEXS);
|
||||
|
||||
@@ -24,9 +24,9 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class RecipientPreferenceDatabase extends Database {
|
||||
public class RecipientDatabase extends Database {
|
||||
|
||||
private static final String TAG = RecipientPreferenceDatabase.class.getSimpleName();
|
||||
private static final String TAG = RecipientDatabase.class.getSimpleName();
|
||||
private static final String RECIPIENT_PREFERENCES_URI = "content://textsecure/recipients/";
|
||||
|
||||
static final String TABLE_NAME = "recipient_preferences";
|
||||
@@ -93,7 +93,7 @@ public class RecipientPreferenceDatabase extends Database {
|
||||
SIGNAL_PROFILE_AVATAR + " TEXT DEFAULT NULL, " +
|
||||
PROFILE_SHARING + " INTEGER DEFAULT 0);";
|
||||
|
||||
public RecipientPreferenceDatabase(Context context, SQLiteOpenHelper databaseHelper) {
|
||||
public RecipientDatabase(Context context, SQLiteOpenHelper databaseHelper) {
|
||||
super(context, databaseHelper);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.crypto.MasterCipher;
|
||||
import org.thoughtcrime.securesms.database.GroupDatabase.GroupRecord;
|
||||
import org.thoughtcrime.securesms.database.MessagingDatabase.MarkedMessageInfo;
|
||||
import org.thoughtcrime.securesms.database.RecipientPreferenceDatabase.RecipientsPreferences;
|
||||
import org.thoughtcrime.securesms.database.RecipientDatabase.RecipientsPreferences;
|
||||
import org.thoughtcrime.securesms.database.model.DisplayRecord;
|
||||
import org.thoughtcrime.securesms.database.model.MediaMmsMessageRecord;
|
||||
import org.thoughtcrime.securesms.database.model.MessageRecord;
|
||||
@@ -99,7 +99,7 @@ public class ThreadDatabase extends Database {
|
||||
.toList();
|
||||
|
||||
private static final List<String> COMBINED_THREAD_RECIPIENT_GROUP_PROJECTION = Stream.concat(Stream.concat(Stream.of(TYPED_THREAD_PROJECTION),
|
||||
Stream.of(RecipientPreferenceDatabase.TYPED_RECIPIENT_PROJECTION)),
|
||||
Stream.of(RecipientDatabase.TYPED_RECIPIENT_PROJECTION)),
|
||||
Stream.of(GroupDatabase.TYPED_GROUP_PROJECTION))
|
||||
.toList();
|
||||
|
||||
@@ -347,8 +347,8 @@ public class ThreadDatabase extends Database {
|
||||
String projection = Util.join(COMBINED_THREAD_RECIPIENT_GROUP_PROJECTION, ",");
|
||||
SQLiteDatabase db = databaseHelper.getReadableDatabase();
|
||||
Cursor cursor = db.rawQuery("SELECT " + projection + " FROM " + TABLE_NAME +
|
||||
" LEFT OUTER JOIN " + RecipientPreferenceDatabase.TABLE_NAME +
|
||||
" ON " + TABLE_NAME + "." + ADDRESS + " = " + RecipientPreferenceDatabase.TABLE_NAME + "." + RecipientPreferenceDatabase.ADDRESS +
|
||||
" LEFT OUTER JOIN " + RecipientDatabase.TABLE_NAME +
|
||||
" ON " + TABLE_NAME + "." + ADDRESS + " = " + RecipientDatabase.TABLE_NAME + "." + RecipientDatabase.ADDRESS +
|
||||
" LEFT OUTER JOIN " + GroupDatabase.TABLE_NAME +
|
||||
" ON " + TABLE_NAME + "." + ADDRESS + " = " + GroupDatabase.TABLE_NAME + "." + GroupDatabase.GROUP_ID +
|
||||
" WHERE " + ARCHIVED + " = ? AND " + MESSAGE_COUNT + " != 0" +
|
||||
@@ -365,8 +365,8 @@ public class ThreadDatabase extends Database {
|
||||
String projection = Util.join(COMBINED_THREAD_RECIPIENT_GROUP_PROJECTION, ",");
|
||||
|
||||
return db.rawQuery("SELECT " + projection + " FROM " + TABLE_NAME +
|
||||
" LEFT OUTER JOIN " + RecipientPreferenceDatabase.TABLE_NAME +
|
||||
" ON " + TABLE_NAME + "." + ADDRESS + " = " + RecipientPreferenceDatabase.TABLE_NAME + "." + ADDRESS +
|
||||
" LEFT OUTER JOIN " + RecipientDatabase.TABLE_NAME +
|
||||
" ON " + TABLE_NAME + "." + ADDRESS + " = " + RecipientDatabase.TABLE_NAME + "." + ADDRESS +
|
||||
" ORDER BY " + TABLE_NAME + "." + DATE + " DESC",
|
||||
null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user