From 9ca54e9adc3265701dae983d0bad07cef5891536 Mon Sep 17 00:00:00 2001 From: Dmitry Novotochinov Date: Wed, 13 Dec 2017 15:25:55 +0300 Subject: [PATCH] Offline inbox support for public chats - Add `allowP2P` flag to group messages filter - Remove `to` option from historic messages whisper request --- src/status_im/protocol/group.cljs | 12 +++++++++--- src/status_im/protocol/web3/inbox.cljs | 3 +-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/status_im/protocol/group.cljs b/src/status_im/protocol/group.cljs index 6e543fe012..a6a25bacbe 100644 --- a/src/status_im/protocol/group.cljs +++ b/src/status_im/protocol/group.cljs @@ -2,6 +2,7 @@ (:require [status-im.protocol.web3.delivery :as d] [status-im.protocol.web3.utils :as u] + [status-im.utils.config :as config] [cljs.spec.alpha :as s] [taoensso.timbre :refer-macros [debug]] [status-im.protocol.validation :refer-macros [valid?]] @@ -136,9 +137,14 @@ (fn [key-id] (f/add-filter! web3 - {:topics [f/status-topic] - :key key-id - :type :sym} + (if config/offline-inbox-enabled? + {:topics [f/status-topic] + :key key-id + :allowP2P true + :type :sym} + {:topics [f/status-topic] + :key key-id + :type :sym}) (l/message-listener {:web3 web3 :identity identity :callback callback diff --git a/src/status_im/protocol/web3/inbox.cljs b/src/status_im/protocol/web3/inbox.cljs index ff042289a8..69045bf216 100644 --- a/src/status_im/protocol/web3/inbox.cljs +++ b/src/status_im/protocol/web3/inbox.cljs @@ -47,8 +47,7 @@ :params [{:peer enode :topic topic :symKeyID sym-key-id - :from 0 - :to 1612505820}]} + :from 0}]} payload (.stringify js/JSON (clj->js args))] (log/info "offline inbox: request-messages request") (log/info "offline inbox: request-messages args" (pr-str args))