vn-verdnaturachat/patches/@nozbe+watermelondb+0.19.0....

69 lines
3.0 KiB
Diff
Raw Normal View History

[NEW] E2E Encryption push (iOS) (#2463) * link pods to notification service * push encryption poc * decrypt room key poc * read user key from mmkv and cast into a pkcs * push decrypt poc (iOS) * expose needed watermelon methods * watermelon -> database * indent & simple-crypto update * string extensions * storage * toBase64 -> toData * remove a forced unwrap * remove unused import * database driver * improvement * folder structure & watermelon bridge * more improvement stuff * watermelon -> database * reuse database instance * improvement * database fix: bypass watermelon cache * some code improvements * encryption instances * start api stuff * network layer * improve notification service * improve folder structure * watermelon patch * retry fetch logic * rocketchat class * fix try to decrypt without a roomKey * fallback to original content that is translated * some fixes to rocketchat logic * merge develop * remove unnecessary extension * [CHORE] Improve reply notification code (iOS) * undo sign changes * remove mocked value * import direct from library * send message request * reply notification with encrypted message working properly * revert apple sign * fix api onerror * trick to display sender name on group notifications * revert data.host change * fix some multithread issues * use sendername sent by server * small improvement * Bump crypto lib * Update ios/NotificationService/NotificationService.swift * add experimental string * remove trailing slash * remove trailing slash on reply * fix decrypt messages Co-authored-by: Diego Mello <diegolmello@gmail.com>
2020-09-24 18:34:13 +00:00
diff --git a/node_modules/@nozbe/watermelondb/native/ios/WatermelonDB/Database.swift b/node_modules/@nozbe/watermelondb/native/ios/WatermelonDB/Database.swift
index 43f2c9c..e24a24f 100644
--- a/node_modules/@nozbe/watermelondb/native/ios/WatermelonDB/Database.swift
+++ b/node_modules/@nozbe/watermelondb/native/ios/WatermelonDB/Database.swift
@@ -1,14 +1,14 @@
import Foundation
-class Database {
- typealias SQL = String
- typealias TableName = String
- typealias QueryArgs = [Any]
+public class Database {
+ public typealias SQL = String
+ public typealias TableName = String
+ public typealias QueryArgs = [Any]
private let fmdb: FMDatabase
private let path: String
- init(path: String) {
+ public init(path: String) {
self.path = path
fmdb = FMDatabase(path: path)
open()
@@ -53,7 +53,7 @@ class Database {
}
}
- func queryRaw(_ query: SQL, _ args: QueryArgs = []) throws -> AnyIterator<FMResultSet> {
+ public func queryRaw(_ query: SQL, _ args: QueryArgs = []) throws -> AnyIterator<FMResultSet> {
let resultSet = try fmdb.executeQuery(query, values: args)
return AnyIterator {
diff --git a/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/Database.kt b/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/Database.kt
index 2217222..5b2eb73 100644
--- a/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/Database.kt
+++ b/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/Database.kt
@@ -5,7 +5,7 @@ import android.database.Cursor
import android.database.sqlite.SQLiteDatabase
import java.io.File
-class Database(private val name: String, private val context: Context) {
+public class Database(private val name: String, private val context: Context) {
private val db: SQLiteDatabase by lazy {
SQLiteDatabase.openOrCreateDatabase(
@@ -41,7 +41,7 @@ class Database(private val name: String, private val context: Context) {
fun delete(query: SQL, args: QueryArgs) = db.execSQL(query, args)
- fun rawQuery(query: SQL, args: RawQueryArgs = emptyArray()): Cursor = db.rawQuery(query, args)
+ public fun rawQuery(query: SQL, args: RawQueryArgs = emptyArray()): Cursor = db.rawQuery(query, args)
fun count(query: SQL, args: RawQueryArgs = emptyArray()): Int =
rawQuery(query, args).use {
diff --git a/node_modules/@nozbe/watermelondb/decorators/date/index.js b/node_modules/@nozbe/watermelondb/decorators/date/index.js
index 65690af..ce71aa0 100644
--- a/node_modules/@nozbe/watermelondb/decorators/date/index.js
+++ b/node_modules/@nozbe/watermelondb/decorators/date/index.js
@@ -44,7 +44,7 @@ var dateDecorator = (0, _makeDecorator.default)(function (columnName) {
var rawValue = date ? +new Date(date) : null;
if (rawValue && date) {
- cache.set(rawValue, date);
+ cache.set(rawValue, new Date(date));
}
this.asModel._setRaw(columnName, rawValue);