Cleaned up the outdated message logic

This commit is contained in:
Morgan Pretty
2023-06-08 10:12:17 +10:00
parent d093d676f6
commit 6af009c9ee
4 changed files with 40 additions and 131 deletions

View File

@@ -1221,11 +1221,6 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co
recipientDb.setRecipientHash(recipient, recipientHash)
}
override fun getThreadArchived(threadId: Long): Boolean {
val threadDB = DatabaseComponent.get(context).threadDatabase()
return threadDB.getThreadArchived(threadId)
}
override fun getLastUpdated(threadID: Long): Long {
val threadDB = DatabaseComponent.get(context).threadDatabase()
return threadDB.getLastUpdated(threadID)

View File

@@ -658,24 +658,6 @@ public class ThreadDatabase extends Database {
return getOrCreateThreadIdFor(recipient, DistributionTypes.DEFAULT);
}
public boolean getThreadArchived(long threadId) {
SQLiteDatabase db = databaseHelper.getReadableDatabase();
Cursor cursor = null;
try {
cursor = db.query(TABLE_NAME, null, ID + " = ?", new String[] {threadId+""}, null, null, null);
if (cursor != null && cursor.moveToFirst()) {
return (cursor.getInt(cursor.getColumnIndexOrThrow(ARCHIVED)) == 1);
}
} finally {
if (cursor != null)
cursor.close();
}
return false;
}
public void setThreadArchived(long threadId) {
ContentValues contentValues = new ContentValues(1);
contentValues.put(ARCHIVED, 1);