Prepare for OGS timestamp handling changes

This commit is contained in:
nielsandriesse
2021-05-31 11:23:37 +10:00
parent eac0e62e5b
commit f872c2b9be
2 changed files with 5 additions and 1 deletions

View File

@@ -232,7 +232,10 @@ object OpenGroupAPIV2 {
return send(request).map { json ->
@Suppress("UNCHECKED_CAST") val rawMessage = json["message"] as? Map<String, Any>
?: throw Error.ParsingFailed
OpenGroupMessageV2.fromJSON(rawMessage) ?: throw Error.ParsingFailed
val result = OpenGroupMessageV2.fromJSON(rawMessage) ?: throw Error.ParsingFailed
val storage = MessagingModuleConfiguration.shared.storage
storage.addReceivedMessageTimestamp(result.sentTimestamp)
result
}
}
// endregion