Add mark all read

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
This commit is contained in:
Andrea Maria Piana 2020-02-18 20:23:02 +01:00
parent c9d1adbc27
commit 21ef5a68b8
No known key found for this signature in database
GPG Key ID: AA6CCA6DE0E06424
23 changed files with 87 additions and 132 deletions

View File

@ -118,6 +118,18 @@
[{:keys [db] :as cofx} chat-id] [{:keys [db] :as cofx} chat-id]
(chats-store/save-chat cofx (get-in db [:chats chat-id]))) (chats-store/save-chat cofx (get-in db [:chats chat-id])))
(fx/defn handle-mark-all-read-successful
{:events [::mark-all-read-successful]}
[{:keys [db] :as cofx} chat-id]
{:db (assoc-in db [:chats chat-id :unviewed-messages-count] 0)})
(fx/defn handle-mark-all-read
{:events [:chat.ui/mark-all-read-pressed]}
[{:keys [db] :as cofx} chat-id]
{::json-rpc/call [{:method (json-rpc/call-ext-method "markAllRead")
:params [chat-id]
:on-success #(re-frame/dispatch [::mark-all-read-successful chat-id])}]})
(fx/defn add-public-chat (fx/defn add-public-chat
"Adds new public group chat to db" "Adds new public group chat to db"
[cofx topic] [cofx topic]

View File

@ -209,9 +209,7 @@
(fx/defn resend-message (fx/defn resend-message
[{:keys [db] :as cofx} chat-id message-id] [{:keys [db] :as cofx} chat-id message-id]
(fx/merge cofx (fx/merge cofx
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "reSendChatMessage")
"wakuext_reSendChatMessage"
"shhext_reSendChatMessage")
:params [message-id] :params [message-id]
:on-success #(log/debug "re-sent message successfully") :on-success #(log/debug "re-sent message successfully")
:on-error #(log/error "failed to re-send message" %)}]} :on-error #(log/error "failed to re-send message" %)}]}

View File

@ -24,26 +24,20 @@
{:events [::accept-request-address-for-transaction]} {:events [::accept-request-address-for-transaction]}
[{:keys [db]} message-id address] [{:keys [db]} message-id address]
{:db (dissoc db :commands/select-account) {:db (dissoc db :commands/select-account)
::json-rpc/call [{:method (if config/waku-enabled? ::json-rpc/call [{:method (json-rpc/call-ext-method "acceptRequestAddressForTransaction")
"wakuext_acceptRequestAddressForTransaction"
"shhext_acceptRequestAddressForTransaction")
:params [message-id address] :params [message-id address]
:on-success #(re-frame/dispatch [:transport/message-sent % 1])}]}) :on-success #(re-frame/dispatch [:transport/message-sent % 1])}]})
(fx/defn handle-decline-request-address-for-transaction (fx/defn handle-decline-request-address-for-transaction
{:events [::decline-request-address-for-transaction]} {:events [::decline-request-address-for-transaction]}
[cofx message-id] [cofx message-id]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "declineRequestAddressForTransaction")
"wakuext_declineRequestAddressForTransaction"
"shhext_declineRequestAddressForTransaction")
:params [message-id] :params [message-id]
:on-success #(re-frame/dispatch [:transport/message-sent % 1])}]}) :on-success #(re-frame/dispatch [:transport/message-sent % 1])}]})
(fx/defn handle-decline-request-transaction (fx/defn handle-decline-request-transaction
{:events [::decline-request-transaction]} {:events [::decline-request-transaction]}
[cofx message-id] [cofx message-id]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "declineRequestTransaction")
"wakuext_declineRequestTransaction"
"shhext_declineRequestTransaction")
:params [message-id] :params [message-id]
:on-success #(re-frame/dispatch [:transport/message-sent % 1])}]}) :on-success #(re-frame/dispatch [:transport/message-sent % 1])}]})

View File

@ -86,9 +86,7 @@
(fx/defn send-contact-request (fx/defn send-contact-request
[{:keys [db] :as cofx} {:keys [public-key] :as contact}] [{:keys [db] :as cofx} {:keys [public-key] :as contact}]
(let [{:keys [name profile-image]} (own-info db)] (let [{:keys [name profile-image]} (own-info db)]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "sendContactUpdate")
"wakuext_sendContactUpdate"
"shhext_sendContactUpdate")
:params [public-key name profile-image] :params [public-key name profile-image]
:on-success #(log/debug "contact request sent" public-key)}]})) :on-success #(log/debug "contact request sent" public-key)}]}))

View File

@ -114,17 +114,13 @@
(dissoc :chatType :members))) (dissoc :chatType :members)))
(fx/defn save-chat [cofx {:keys [chat-id] :as chat}] (fx/defn save-chat [cofx {:keys [chat-id] :as chat}]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "saveChat")
"wakuext_saveChat"
"shhext_saveChat")
:params [(->rpc chat)] :params [(->rpc chat)]
:on-success #(log/debug "saved chat" chat-id "successfuly") :on-success #(log/debug "saved chat" chat-id "successfuly")
:on-failure #(log/error "failed to save chat" chat-id %)}]}) :on-failure #(log/error "failed to save chat" chat-id %)}]})
(fx/defn fetch-chats-rpc [cofx {:keys [on-success]}] (fx/defn fetch-chats-rpc [cofx {:keys [on-success]}]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "chats")
"wakuext_chats"
"shhext_chats")
:params [] :params []
:on-success #(on-success (map <-rpc %)) :on-success #(on-success (map <-rpc %))
:on-failure #(log/error "failed to fetch chats" 0 -1 %)}]}) :on-failure #(log/error "failed to fetch chats" 0 -1 %)}]})

View File

@ -46,26 +46,20 @@
(fx/defn fetch-contacts-rpc (fx/defn fetch-contacts-rpc
[cofx on-success] [cofx on-success]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "contacts")
"wakuext_contacts"
"shhext_contacts")
:params [] :params []
:on-success #(on-success (map <-rpc %)) :on-success #(on-success (map <-rpc %))
:on-failure #(log/error "failed to fetch contacts" %)}]}) :on-failure #(log/error "failed to fetch contacts" %)}]})
(fx/defn save-contact (fx/defn save-contact
[cofx {:keys [public-key] :as contact}] [cofx {:keys [public-key] :as contact}]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "saveContact")
"wakuext_saveContact"
"shhext_saveContact")
:params [(->rpc contact)] :params [(->rpc contact)]
:on-success #(log/debug "saved contact" public-key "successfuly") :on-success #(log/debug "saved contact" public-key "successfuly")
:on-failure #(log/error "failed to save contact" public-key %)}]}) :on-failure #(log/error "failed to save contact" public-key %)}]})
(fx/defn block [cofx contact on-success] (fx/defn block [cofx contact on-success]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "blockContact")
"wakuext_blockContact"
"shhext_blockContact")
:params [(->rpc contact)] :params [(->rpc contact)]
:on-success on-success :on-success on-success
:on-failure #(log/error "failed to block contact" % contact)}]}) :on-failure #(log/error "failed to block contact" % contact)}]})

View File

@ -47,17 +47,13 @@
(dissoc :ensName :chatId :text :rtl :responseTo :sticker :lineCount :parsedText))) (dissoc :ensName :chatId :text :rtl :responseTo :sticker :lineCount :parsedText)))
(defn update-outgoing-status-rpc [message-id status] (defn update-outgoing-status-rpc [message-id status]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "updateMessageOutgoingStatus")
"wakuext_updateMessageOutgoingStatus"
"shhext_updateMessageOutgoingStatus")
:params [message-id status] :params [message-id status]
:on-success #(log/debug "updated message outgoing stauts" message-id status) :on-success #(log/debug "updated message outgoing stauts" message-id status)
:on-failure #(log/error "failed to update message outgoing status" message-id status %)}]}) :on-failure #(log/error "failed to update message outgoing status" message-id status %)}]})
(defn save-system-messages-rpc [messages] (defn save-system-messages-rpc [messages]
(json-rpc/call {:method (if config/waku-enabled? (json-rpc/call {:method (json-rpc/call-ext-method "addSystemMessages")
"wakuext_addSystemMessages"
"shhext_addSystemMessages")
:params [(map ->rpc messages)] :params [(map ->rpc messages)]
:on-success #(re-frame/dispatch [:messages/system-messages-saved (map <-rpc %)]) :on-success #(re-frame/dispatch [:messages/system-messages-saved (map <-rpc %)])
:on-failure #(log/error "failed to save messages" %)})) :on-failure #(log/error "failed to save messages" %)}))
@ -67,42 +63,32 @@
limit limit
on-success on-success
on-failure] on-failure]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "chatMessages")
"wakuext_chatMessages"
"shhext_chatMessages")
:params [chat-id cursor limit] :params [chat-id cursor limit]
:on-success (fn [result] :on-success (fn [result]
(on-success (update result :messages #(map <-rpc %)))) (on-success (update result :messages #(map <-rpc %))))
:on-failure on-failure}]}) :on-failure on-failure}]})
(defn mark-seen-rpc [chat-id ids] (defn mark-seen-rpc [chat-id ids]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "markMessagesSeen")
"wakuext_markMessagesSeen"
"shhext_markMessagesSeen")
:params [chat-id ids] :params [chat-id ids]
:on-success #(log/debug "successfully marked as seen") :on-success #(log/debug "successfully marked as seen")
:on-failure #(log/error "failed to get messages" %)}]}) :on-failure #(log/error "failed to get messages" %)}]})
(defn delete-message-rpc [id] (defn delete-message-rpc [id]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "deleteMessage")
"wakuext_deleteMessage"
"shhext_deleteMessage")
:params [id] :params [id]
:on-success #(log/debug "successfully deleted message" id) :on-success #(log/debug "successfully deleted message" id)
:on-failure #(log/error "failed to delete message" % id)}]}) :on-failure #(log/error "failed to delete message" % id)}]})
(defn delete-messages-from-rpc [author] (defn delete-messages-from-rpc [author]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "deleteMessagesFrom")
"wakuext_deleteMessagesFrom"
"shhext_deleteMessagesFrom")
:params [author] :params [author]
:on-success #(log/debug "successfully deleted messages from" author) :on-success #(log/debug "successfully deleted messages from" author)
:on-failure #(log/error "failed to delete messages from" % author)}]}) :on-failure #(log/error "failed to delete messages from" % author)}]})
(defn delete-messages-by-chat-id-rpc [chat-id] (defn delete-messages-by-chat-id-rpc [chat-id]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "deleteMessagesByChatID")
"wakuext_deleteMessagesByChatID"
"shhext_deleteMessagesByChatID")
:params [chat-id] :params [chat-id]
:on-success #(log/debug "successfully deleted messages by chat-id" chat-id) :on-success #(log/debug "successfully deleted messages by chat-id" chat-id)
:on-failure #(log/error "failed to delete messages by chat-id" % chat-id)}]}) :on-failure #(log/error "failed to delete messages by chat-id" % chat-id)}]})

View File

@ -293,9 +293,7 @@
(navigation/navigate-to-cofx :ens-search {}))) (navigation/navigate-to-cofx :ens-search {})))
(defn verify-names [names] (defn verify-names [names]
(json-rpc/call {:method (if config/waku-enabled? (json-rpc/call {:method (json-rpc/call-ext-method "verifyENSNames")
"wakuext_verifyENSNames"
"shhext_verifyENSNames")
:params [names] :params [names]
:on-success #(re-frame/dispatch [:contacts/ens-names-verified %]) :on-success #(re-frame/dispatch [:contacts/ens-names-verified %])
:on-failure #(log/error "failed to resolve ens names" % names)})) :on-failure #(log/error "failed to resolve ens names" % names)}))

View File

@ -2,6 +2,7 @@
(:require [clojure.string :as string] (:require [clojure.string :as string]
[re-frame.core :as re-frame] [re-frame.core :as re-frame]
[status-im.ethereum.abi-spec :as abi-spec] [status-im.ethereum.abi-spec :as abi-spec]
[status-im.utils.config :as config]
[status-im.ethereum.decode :as decode] [status-im.ethereum.decode :as decode]
[status-im.native-module.core :as status] [status-im.native-module.core :as status]
[status-im.utils.money :as money] [status-im.utils.money :as money]
@ -64,6 +65,7 @@
"shhext_deleteMessagesByChatID" {} "shhext_deleteMessagesByChatID" {}
"shhext_deleteMessage" {} "shhext_deleteMessage" {}
"shhext_markMessagesSeen" {} "shhext_markMessagesSeen" {}
"shhext_markAllRead" {}
"shhext_confirmMessagesProcessedByID" {} "shhext_confirmMessagesProcessedByID" {}
"shhext_updateMessageOutgoingStatus" {} "shhext_updateMessageOutgoingStatus" {}
"shhext_chatMessages" {} "shhext_chatMessages" {}
@ -114,6 +116,7 @@
"wakuext_deleteMessagesByChatID" {} "wakuext_deleteMessagesByChatID" {}
"wakuext_deleteMessage" {} "wakuext_deleteMessage" {}
"wakuext_markMessagesSeen" {} "wakuext_markMessagesSeen" {}
"wakuext_markAllRead" {}
"wakuext_confirmMessagesProcessedByID" {} "wakuext_confirmMessagesProcessedByID" {}
"wakuext_updateMessageOutgoingStatus" {} "wakuext_updateMessageOutgoingStatus" {}
"wakuext_chatMessages" {} "wakuext_chatMessages" {}
@ -175,6 +178,11 @@
(call-method (update arg :number-of-retries dec))) (call-method (update arg :number-of-retries dec)))
on-error)) on-error))
(defn call-ext-method [method]
(if config/waku-enabled?
(str "wakuext_" method)
(str "shhext_" method)))
(defn call (defn call
[{:keys [method params on-success] :as arg}] [{:keys [method params on-success] :as arg}]
(if-let [method-options (json-rpc-api method)] (if-let [method-options (json-rpc-api method)]

View File

@ -31,9 +31,7 @@
(fx/defn remove-member (fx/defn remove-member
"Format group update message and sign membership" "Format group update message and sign membership"
[{:keys [db] :as cofx} chat-id member] [{:keys [db] :as cofx} chat-id member]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "removeMemberFromGroupChat")
"wakuext_removeMemberFromGroupChat"
"shhext_removeMemberFromGroupChat")
:params [nil chat-id member] :params [nil chat-id member]
:on-success #(re-frame/dispatch [::chat-updated %])}]}) :on-success #(re-frame/dispatch [::chat-updated %])}]})
@ -76,43 +74,33 @@
(fx/defn join-chat (fx/defn join-chat
[cofx chat-id] [cofx chat-id]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "confirmJoiningGroup")
"wakuext_confirmJoiningGroup"
"shhext_confirmJoiningGroup")
:params [chat-id] :params [chat-id]
:on-success #(re-frame/dispatch [::chat-updated %])}]}) :on-success #(re-frame/dispatch [::chat-updated %])}]})
(fx/defn create (fx/defn create
[{:keys [db] :as cofx} group-name] [{:keys [db] :as cofx} group-name]
(let [selected-contacts (:group/selected-contacts db)] (let [selected-contacts (:group/selected-contacts db)]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "createGroupChatWithMembers")
"wakuext_createGroupChatWithMembers"
"shhext_createGroupChatWithMembers")
:params [nil group-name (into [] selected-contacts)] :params [nil group-name (into [] selected-contacts)]
:on-success #(re-frame/dispatch [::chat-updated %])}]})) :on-success #(re-frame/dispatch [::chat-updated %])}]}))
(fx/defn make-admin (fx/defn make-admin
[{:keys [db] :as cofx} chat-id member] [{:keys [db] :as cofx} chat-id member]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "addAdminsToGroupChat")
"wakuext_addAdminsToGroupChat"
"shhext_addAdminsToGroupChat")
:params [nil chat-id [member]] :params [nil chat-id [member]]
:on-success #(re-frame/dispatch [::chat-updated %])}]}) :on-success #(re-frame/dispatch [::chat-updated %])}]})
(fx/defn add-members (fx/defn add-members
"Add members to a group chat" "Add members to a group chat"
[{{:keys [current-chat-id selected-participants]} :db :as cofx}] [{{:keys [current-chat-id selected-participants]} :db :as cofx}]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "addMembersToGroupChat")
"wakuext_addMembersToGroupChat"
"shhext_addMembersToGroupChat")
:params [nil current-chat-id selected-participants] :params [nil current-chat-id selected-participants]
:on-success #(re-frame/dispatch [::chat-updated %])}]}) :on-success #(re-frame/dispatch [::chat-updated %])}]})
(fx/defn remove (fx/defn remove
"Remove & leave chat" "Remove & leave chat"
[{:keys [db] :as cofx} chat-id] [{:keys [db] :as cofx} chat-id]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "leaveGroupChat")
"wakuext_leaveGroupChat"
"shhext_leaveGroupChat")
:params [nil chat-id] :params [nil chat-id]
:on-success #(re-frame/dispatch [::chat-updated %])}]}) :on-success #(re-frame/dispatch [::chat-updated %])}]})
@ -135,9 +123,7 @@
(let [new-name (get-in cofx [:db :group-chat-profile/profile :name]) (let [new-name (get-in cofx [:db :group-chat-profile/profile :name])
current-chat-id (:current-chat-id db)] current-chat-id (:current-chat-id db)]
(when (valid-name? new-name) (when (valid-name? new-name)
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "changeGroupChatName")
"wakuext_changeGroupChatName"
"shhext_changeGroupChatName")
:params [nil current-chat-id new-name] :params [nil current-chat-id new-name]
:on-success #(re-frame/dispatch [::chat-updated %])}]}))) :on-success #(re-frame/dispatch [::chat-updated %])}]})))

View File

@ -89,9 +89,7 @@
;; as sent. ;; as sent.
(defn update-mailservers! [enodes] (defn update-mailservers! [enodes]
(json-rpc/call (json-rpc/call
{:method (if config/waku-enabled? {:method (json-rpc/call-ext-method "updateMailservers")
"wakuext_updateMailservers"
"shhext_updateMailservers")
:params [enodes] :params [enodes]
:on-success #(log/debug "mailserver: update-mailservers success" %) :on-success #(log/debug "mailserver: update-mailservers success" %)
:on-error #(log/error "mailserver: update-mailservers error" %)})) :on-error #(log/error "mailserver: update-mailservers error" %)}))
@ -363,9 +361,7 @@
" cursor " cursor " cursor " cursor
" limit " actual-limit) " limit " actual-limit)
(json-rpc/call (json-rpc/call
{:method (if config/waku-enabled? {:method (json-rpc/call-ext-method "requestMessages")
"wakuext_requestMessages"
"shhext_requestMessages")
:params [(cond-> {:topics topics :params [(cond-> {:topics topics
:mailServerPeer address :mailServerPeer address
:symKeyID sym-key-id :symKeyID sym-key-id

View File

@ -10,9 +10,7 @@
(fx/defn send-multiaccount-update [{:keys [db]}] (fx/defn send-multiaccount-update [{:keys [db]}]
(let [multiaccount (:multiaccount db) (let [multiaccount (:multiaccount db)
{:keys [name preferred-name photo-path address]} multiaccount] {:keys [name preferred-name photo-path address]} multiaccount]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "sendContactUpdates")
"wakuext_sendContactUpdates"
"shhext_sendContactUpdates")
:params [(or preferred-name name) photo-path] :params [(or preferred-name name) photo-path]
:on-success #(log/debug "sent contact update")}]})) :on-success #(log/debug "sent contact update")}]}))

View File

@ -25,9 +25,7 @@
{:keys [name preferred-name photo-path address]} multiaccount] {:keys [name preferred-name photo-path address]} multiaccount]
(log/debug "sending contact updates") (log/debug "sending contact updates")
(json-rpc/call {:method (if config/waku-enabled? (json-rpc/call {:method (json-rpc/call-ext-method "sendContactUpdates")
"wakuext_sendContactUpdates"
"shhext_sendContactUpdates")
:params [(or preferred-name name) photo-path] :params [(or preferred-name name) photo-path]
:on-failure #(do :on-failure #(do
(log/warn "failed to send contact updates") (log/warn "failed to send contact updates")

View File

@ -19,33 +19,25 @@
[status-im.utils.types :as types])) [status-im.utils.types :as types]))
(defn enable-installation-rpc [installation-id on-success on-failure] (defn enable-installation-rpc [installation-id on-success on-failure]
(json-rpc/call {:method (if config/waku-enabled? (json-rpc/call {:method (json-rpc/call-ext-method "enableInstallation")
"wakuext_enableInstallation"
"shhext_enableInstallation")
:params [installation-id] :params [installation-id]
:on-success on-success :on-success on-success
:on-failure on-failure})) :on-failure on-failure}))
(defn disable-installation-rpc [installation-id on-success on-failure] (defn disable-installation-rpc [installation-id on-success on-failure]
(json-rpc/call {:method (if config/waku-enabled? (json-rpc/call {:method (json-rpc/call-ext-method "disableInstallation")
"wakuext_disableInstallation"
"shhext_disableInstallation")
:params [installation-id] :params [installation-id]
:on-success on-success :on-success on-success
:on-failure on-failure})) :on-failure on-failure}))
(defn set-installation-metadata-rpc [installation-id metadata on-success on-failure] (defn set-installation-metadata-rpc [installation-id metadata on-success on-failure]
(json-rpc/call {:method (if config/waku-enabled? (json-rpc/call {:method (json-rpc/call-ext-method "setInstallationMetadata")
"wakuext_setInstallationMetadata"
"shhext_setInstallationMetadata")
:params [installation-id metadata] :params [installation-id metadata]
:on-success on-success :on-success on-success
:on-failure on-failure})) :on-failure on-failure}))
(defn get-our-installations-rpc [on-success on-failure] (defn get-our-installations-rpc [on-success on-failure]
(json-rpc/call {:method (if config/waku-enabled? (json-rpc/call {:method (json-rpc/call-ext-method "getOurInstallations")
"wakuext_getOurInstallations"
"shhext_getOurInstallations")
:params [] :params []
:on-success on-success :on-success on-success
:on-failure on-failure})) :on-failure on-failure}))
@ -73,9 +65,7 @@
(defn send-pair-installation (defn send-pair-installation
[cofx] [cofx]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "sendPairInstallation")
"wakuext_sendPairInstallation"
"shhext_sendPairInstallation")
:params [] :params []
:on-success #(log/info "sent pair installation message")}]}) :on-success #(log/info "sent pair installation message")}]})
@ -199,9 +189,7 @@
(defn send-installation-messages [{:keys [db]}] (defn send-installation-messages [{:keys [db]}]
(let [multiaccount (:multiaccount db) (let [multiaccount (:multiaccount db)
{:keys [name preferred-name photo-path]} multiaccount] {:keys [name preferred-name photo-path]} multiaccount]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "syncDevices")
"wakuext_syncDevices"
"shhext_syncDevices")
:params [(or preferred-name name) photo-path] :params [(or preferred-name name) photo-path]
:on-success #(log/debug "successfully synced devices")}]})) :on-success #(log/debug "successfully synced devices")}]}))

View File

@ -212,9 +212,7 @@
(fx/defn send-transaction-message (fx/defn send-transaction-message
{:events [::send-transaction-message]} {:events [::send-transaction-message]}
[cofx chat-id value contract transaction-hash signature] [cofx chat-id value contract transaction-hash signature]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "sendTransaction")
"wakuext_sendTransaction"
"shhext_sendTransaction")
:params [chat-id value contract transaction-hash :params [chat-id value contract transaction-hash
(:result (types/json->clj signature))] (:result (types/json->clj signature))]
:on-success :on-success
@ -223,9 +221,7 @@
(fx/defn send-accept-request-transaction-message (fx/defn send-accept-request-transaction-message
{:events [::send-accept-transaction-message]} {:events [::send-accept-transaction-message]}
[cofx message-id transaction-hash signature] [cofx message-id transaction-hash signature]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "acceptRequestTransaction")
"wakuext_acceptRequestTransaction"
"shhext_acceptRequestTransaction")
:params [transaction-hash message-id :params [transaction-hash message-id
(:result (types/json->clj signature))] (:result (types/json->clj signature))]
:on-success :on-success

View File

@ -40,9 +40,7 @@
initializiation is completed, otherwise we might receive messages/topics initializiation is completed, otherwise we might receive messages/topics
when the state has not been properly initialized." when the state has not been properly initialized."
[cofx] [cofx]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "startMessenger")
"wakuext_startMessenger"
"shhext_startMessenger")
:on-success #(do :on-success #(do
(log/debug "messenger initialized") (log/debug "messenger initialized")
(re-frame/dispatch [::init-whisper])) (re-frame/dispatch [::init-whisper]))

View File

@ -18,17 +18,13 @@
(string/starts-with? k "0x")) (string/starts-with? k "0x"))
(defn load-filters-rpc [chats on-success on-failure] (defn load-filters-rpc [chats on-success on-failure]
(json-rpc/call {:method (if config/waku-enabled? (json-rpc/call {:method (json-rpc/call-ext-method "loadFilters")
"wakuext_loadFilters"
"shhext_loadFilters")
:params [chats] :params [chats]
:on-success on-success :on-success on-success
:on-failure on-failure})) :on-failure on-failure}))
(defn remove-filters-rpc [chats on-success on-failure] (defn remove-filters-rpc [chats on-success on-failure]
(json-rpc/call {:method (if config/waku-enabled? (json-rpc/call {:method (json-rpc/call-ext-method "removeFilters")
"wakuext_removeFilters"
"shhext_removeFilters")
:params [chats] :params [chats]
:on-success on-success :on-success on-success
:on-failure on-failure})) :on-failure on-failure}))

View File

@ -14,9 +14,7 @@
sticker sticker
content-type] content-type]
:as message}] :as message}]
{::json-rpc/call [{:method (if config/waku-enabled? {::json-rpc/call [{:method (json-rpc/call-ext-method "sendChatMessage")
"wakuext_sendChatMessage"
"shhext_sendChatMessage")
:params [{:chatId chat-id :params [{:chatId chat-id
:text text :text text
:responseTo response-to :responseTo response-to

View File

@ -20,6 +20,8 @@
(when (and group-chat (not public?)) (when (and group-chat (not public?))
{:text (i18n/label :t/group-info) {:text (i18n/label :t/group-info)
:on-select #(re-frame/dispatch [:show-group-chat-profile])}) :on-select #(re-frame/dispatch [:show-group-chat-profile])})
{:text (i18n/label :t/mark-all-read)
:on-select #(re-frame/dispatch [:chat.ui/mark-all-read-pressed chat-id])}
{:text (i18n/label :t/clear-history) {:text (i18n/label :t/clear-history)
:on-select #(re-frame/dispatch [:chat.ui/clear-history-pressed chat-id])} :on-select #(re-frame/dispatch [:chat.ui/clear-history-pressed chat-id])}
{:text (i18n/label :t/fetch-history) {:text (i18n/label :t/fetch-history)

View File

@ -37,6 +37,12 @@
:accessibility-label :view-chat-details-button :accessibility-label :view-chat-details-button
:accessories [:chevron] :accessories [:chevron]
:on-press #(hide-sheet-and-dispatch [:chat.ui/show-profile chat-id])}] :on-press #(hide-sheet-and-dispatch [:chat.ui/show-profile chat-id])}]
[list-item/list-item
{:theme :action
:title :t/mark-all-read
:accessibility-label :mark-all-read-button
:icon :main-icons/check
:on-press #(hide-sheet-and-dispatch [:chat.ui/mark-all-read-pressed chat-id])}]
[list-item/list-item [list-item/list-item
{:theme :action {:theme :action
:title :t/clear-history :title :t/clear-history
@ -69,6 +75,12 @@
:on-press (fn [] :on-press (fn []
(re-frame/dispatch [:bottom-sheet/hide-sheet]) (re-frame/dispatch [:bottom-sheet/hide-sheet])
(list-selection/open-share {:message message}))}]) (list-selection/open-share {:message message}))}])
[list-item/list-item
{:theme :action
:title :t/mark-all-read
:accessibility-label :mark-all-read-button
:icon :main-icons/check
:on-press #(hide-sheet-and-dispatch [:chat.ui/mark-all-read-pressed chat-id])}]
[list-item/list-item [list-item/list-item
{:theme :action {:theme :action
:title :t/clear-history :title :t/clear-history
@ -99,6 +111,12 @@
contact group-chat chat-name color online] contact group-chat chat-name color online]
:accessories [:chevron] :accessories [:chevron]
:on-press #(hide-sheet-and-dispatch [:show-group-chat-profile chat-id])}] :on-press #(hide-sheet-and-dispatch [:show-group-chat-profile chat-id])}]
[list-item/list-item
{:theme :action
:title :t/mark-all-read
:accessibility-label :mark-all-read-button
:icon :main-icons/check
:on-press #(hide-sheet-and-dispatch [:chat.ui/mark-all-read-pressed chat-id])}]
[list-item/list-item [list-item/list-item
{:theme :action {:theme :action
:title :t/clear-history :title :t/clear-history

View File

@ -407,9 +407,7 @@
[to-norm amount-hex])})})) [to-norm amount-hex])})}))
{:db db {:db db
::json-rpc/call ::json-rpc/call
[{:method (if config/waku-enabled? [{:method (json-rpc/call-ext-method "requestAddressForTransaction")
"wakuext_requestAddressForTransaction"
"shhext_requestAddressForTransaction")
:params [(:current-chat-id db) :params [(:current-chat-id db)
from-address from-address
amount amount
@ -428,9 +426,7 @@
{:db (-> db {:db (-> db
(update-in [:chat-ui-props identity] dissoc :input-bottom-sheet) (update-in [:chat-ui-props identity] dissoc :input-bottom-sheet)
(dissoc db :wallet/prepare-transaction)) (dissoc db :wallet/prepare-transaction))
::json-rpc/call [{:method (if config/waku-enabled? ::json-rpc/call [{:method (json-rpc/call-ext-method "requestTransaction")
"wakuext_requestTransaction"
"shhext_requestTransaction")
:params [(:public-key to) :params [(:public-key to)
amount amount
(when-not (= symbol :ETH) (when-not (= symbol :ETH)

View File

@ -2,7 +2,7 @@
"_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead", "_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead",
"owner": "status-im", "owner": "status-im",
"repo": "status-go", "repo": "status-go",
"version": "v0.45.1", "version": "v0.47.0",
"commit-sha1": "9c2c08d44c839895f7e98a0c8f652d094d53cb2f", "commit-sha1": "5cc60de80b315c12c8a0583705be8d5c35b073f2",
"src-sha256": "0b03q4znblj737bgdbxi7qqpxqamii5ja8hw8rk1br0lll4i1jcr" "src-sha256": "1zqbadpwg4iizfwzfmw38hf98hj3zf99a3svyj22bbwqnqaxpbh4"
} }

View File

@ -655,6 +655,7 @@
"mainnet-text": "Youre on the Mainnet. Real ETH will be sent", "mainnet-text": "Youre on the Mainnet. Real ETH will be sent",
"maintain-card-to-phone-contact": "Maintain card-to-phone contact during process.", "maintain-card-to-phone-contact": "Maintain card-to-phone contact during process.",
"make-admin": "Make admin", "make-admin": "Make admin",
"mark-all-read": "Mark all read",
"maybe-later": "Maybe later", "maybe-later": "Maybe later",
"members": { "members": {
"one": "1 member", "one": "1 member",