feat: add open group v2 storage and db methods, starting on new open group v2 poller

This commit is contained in:
jubb
2021-04-13 17:17:16 +10:00
parent 201dde7412
commit 0eadc55325
12 changed files with 485 additions and 115 deletions

View File

@@ -20,6 +20,7 @@ public data class PublicChat(
@JvmStatic fun fromJSON(jsonAsString: String): PublicChat? {
try {
val json = JsonUtil.fromJson(jsonAsString)
if (!json.has("channel")) return null
val channel = json.get("channel").asLong()
val server = json.get("server").asText().toLowerCase()
val displayName = json.get("displayName").asText()

View File

@@ -24,6 +24,11 @@ interface LokiAPIDatabaseProtocol {
fun getLastDeletionServerID(group: Long, server: String): Long?
fun setLastDeletionServerID(group: Long, server: String, newValue: Long)
fun setUserCount(group: Long, server: String, newValue: Int)
fun getLastMessageServerID(room: String, server: String): Long?
fun setLastMessageServerID(room: String, server: String, newValue: Long)
fun getLastDeletionServerID(room: String, server: String): Long?
fun setLastDeletionServerID(room: String, server: String, newValue: Long)
fun setUserCount(room: String, server: String, newValue: Int)
fun getSessionRequestSentTimestamp(publicKey: String): Long?
fun setSessionRequestSentTimestamp(publicKey: String, newValue: Long)
fun getSessionRequestProcessedTimestamp(publicKey: String): Long?