Merge branch 'dev' of https://github.com/loki-project/session-android into open-group-invitations

This commit is contained in:
Brice-W
2021-05-07 09:34:24 +10:00
60 changed files with 2055 additions and 379 deletions

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?

View File

@@ -3,5 +3,5 @@ package org.session.libsignal.service.loki
interface LokiMessageDatabaseProtocol {
fun getQuoteServerID(quoteID: Long, quoteePublicKey: String): Long?
fun setServerID(messageID: Long, serverID: Long)
fun setServerID(messageID: Long, serverID: Long, isSms: Boolean)
}

View File

@@ -3,8 +3,10 @@ package org.session.libsignal.utilities;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.ResolvedType;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.JsonSerializer;
@@ -42,6 +44,10 @@ public class JsonUtil {
return objectMapper.readValue(serialized, clazz);
}
public static<T> T fromJson(String serialized, JavaType clazz) throws IOException {
return objectMapper.readValue(serialized, clazz);
}
public static <T> T fromJson(InputStream serialized, Class<T> clazz) throws IOException {
return objectMapper.readValue(serialized, clazz);
}