mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-03 15:13:50 +00:00
Stub LokiAPIDatabase
This commit is contained in:
@@ -35,6 +35,7 @@ import org.thoughtcrime.securesms.database.SignedPreKeyDatabase;
|
||||
import org.thoughtcrime.securesms.database.SmsDatabase;
|
||||
import org.thoughtcrime.securesms.database.ThreadDatabase;
|
||||
import org.thoughtcrime.securesms.jobs.RefreshPreKeysJob;
|
||||
import org.thoughtcrime.securesms.loki.LokiAPIDatabase;
|
||||
import org.thoughtcrime.securesms.notifications.NotificationChannels;
|
||||
import org.thoughtcrime.securesms.service.KeyCachingService;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
@@ -112,6 +113,7 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
|
||||
for (String sql : JobDatabase.CREATE_TABLE) {
|
||||
db.execSQL(sql);
|
||||
}
|
||||
db.execSQL(LokiAPIDatabase.getCreateTableCommand());
|
||||
|
||||
executeStatements(db, SmsDatabase.CREATE_INDEXS);
|
||||
executeStatements(db, MmsDatabase.CREATE_INDEXS);
|
||||
|
||||
44
src/org/thoughtcrime/securesms/loki/LokiAPIDatabase.kt
Normal file
44
src/org/thoughtcrime/securesms/loki/LokiAPIDatabase.kt
Normal file
@@ -0,0 +1,44 @@
|
||||
package org.thoughtcrime.securesms.loki
|
||||
|
||||
import android.content.Context
|
||||
import org.thoughtcrime.securesms.database.Database
|
||||
import org.thoughtcrime.securesms.database.helpers.SQLCipherOpenHelper
|
||||
import org.whispersystems.signalservice.loki.api.LokiAPIDatabaseProtocol
|
||||
import org.whispersystems.signalservice.loki.api.LokiAPITarget
|
||||
|
||||
class LokiAPIDatabase(context: Context, helper: SQLCipherOpenHelper) : Database(context, helper), LokiAPIDatabaseProtocol {
|
||||
|
||||
companion object {
|
||||
private val tableKey = "loki_api_database"
|
||||
private val swarmCacheKey = "swarm_cache"
|
||||
private val lastMessageHashValueKey = "last_message_hash_value"
|
||||
private val receivedMessageHashValuesKey = "received_message_hash_values"
|
||||
|
||||
@JvmStatic
|
||||
val createTableCommand = "CREATE TABLE $tableKey ($swarmCacheKey TEXT, $lastMessageHashValueKey TEXT, $receivedMessageHashValuesKey TEXT);"
|
||||
}
|
||||
|
||||
override fun getSwarmCache(): Map<String, List<LokiAPITarget>>? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun setSwarmCache(newValue: Map<String, List<LokiAPITarget>>) {
|
||||
// TODO: Implement
|
||||
}
|
||||
|
||||
override fun getLastMessageHashValue(target: LokiAPITarget): String? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun setLastMessageHashValue(target: LokiAPITarget, newValue: String) {
|
||||
// TODO: Implement
|
||||
}
|
||||
|
||||
override fun getReceivedMessageHashValues(): Set<String>? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun setReceivedMessageHashValues(newValue: Set<String>) {
|
||||
// TODO: Implement
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user