Emoji hash is now in settings

Signed-off-by: Vitaliy Vlasov <siphiuel@protonmail.com>
This commit is contained in:
Vitaliy Vlasov 2023-03-03 15:12:56 +02:00
parent 7a9018ae11
commit 9959d537f3
No known key found for this signature in database
GPG Key ID: A7D57C347F2B2964
6 changed files with 9 additions and 43 deletions

View File

@ -1139,11 +1139,6 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
executeRunnableStatusGoMethod(() -> Statusgo.generateAlias(seed), callback);
}
@ReactMethod
public void emojiHash(final String publicKey, final Callback callback) throws JSONException {
executeRunnableStatusGoMethod(() -> Statusgo.emojiHash(publicKey), callback);
}
@ReactMethod(isBlockingSynchronousMethod = true)
public String identicon(final String seed) {
return Statusgo.identicon(seed);

View File

@ -866,12 +866,6 @@ RCT_EXPORT_METHOD(generateAliasAsync:(NSString *)publicKey
callback(@[result]);
}
RCT_EXPORT_METHOD(emojiHash:(NSString *)publicKey
callback:(RCTResponseSenderBlock)callback) {
NSString *result = StatusgoEmojiHash(publicKey);
callback(@[result]);
}
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(identicon:(NSString *)publicKey) {
return StatusgoIdenticon(publicKey);
}

View File

@ -1,6 +1,7 @@
(ns status-im.multiaccounts.login.core
(:require
[clojure.string :as string]
[clojure.set :as set]
[re-frame.core :as re-frame]
[status-im.async-storage.core :as async-storage]
[status-im.communities.core :as communities]
@ -43,8 +44,7 @@
[status-im2.navigation.events :as navigation]
[status-im2.common.log :as logging]
[taoensso.timbre :as log]
[utils.security.core :as security]
[status-im2.contexts.emoji-hash.events :as emoji-hash]))
[utils.security.core :as security]))
(re-frame/reg-fx
::initialize-communities-enabled
@ -388,7 +388,10 @@
(let [{:networks/keys [current-network networks]
:as settings}
(data-store.settings/rpc->settings settings)
multiaccount (dissoc settings :networks/current-network :networks/networks)
multiaccount (-> settings
(dissoc :networks/current-network :networks/networks)
(set/rename-keys {:compressedKey :compressed-key
:emojiHash :emoji-hash}))
;;for some reason we save default networks in db, in case when we want to modify default-networks
;;for
;; existing accounts we have to merge them again into networks
@ -472,7 +475,6 @@
(get-group-chat-invitations)
(multiaccounts/get-profile-picture)
(multiaccounts/switch-preview-privacy-mode-flag)
(emoji-hash/fetch-for-current-public-key)
(link-preview/request-link-preview-whitelist)
(visibility-status-updates-store/fetch-visibility-status-updates-rpc)
(switcher-cards-store/fetch-switcher-cards-rpc))))

View File

@ -481,12 +481,6 @@
(when (validators/valid-public-key? public-key)
(.generateAliasAsync ^js (status) public-key callback)))
(defn public-key->emoji-hash
"Generate an emoji hash from the multiaccount public key"
[public-key callback]
(when (validators/valid-public-key? public-key)
(.emojiHash ^js (status) public-key callback)))
(defn identicon
"Generate a icon based on a string, synchronously"
[seed]

View File

@ -1,19 +0,0 @@
(ns status-im2.contexts.emoji-hash.events
(:require [utils.re-frame :as rf]
[status-im.native-module.core :as native-module]
[utils.transforms :as transform]))
(defn fetch-for-current-public-key
[]
(let [public-key (rf/sub [:multiaccount/public-key])]
(native-module/public-key->emoji-hash
public-key
(fn [response]
(let [response-clj (transform/json->clj response)
emoji-hash (get response-clj :result)]
(rf/dispatch [:emoji-hash/add-to-multiaccount emoji-hash]))))))
(rf/defn add-emoji-hash-to-multiaccount
{:events [:emoji-hash/add-to-multiaccount]}
[{:keys [db]} emoji-hash]
{:db (assoc db :multiaccount/emoji-hash emoji-hash)})

View File

@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "v0.136.1",
"commit-sha1": "9fbc4d51eeb54a1ce3a51066e792e29210bc5496",
"src-sha256": "0aqgq5x360n06mn8qzb925r0wg943ga1b0csbzda9blvya3vznh5"
"version": "v0.136.3",
"commit-sha1": "27a76f43ba5b43a28a95f8df086daa640cea0da6",
"src-sha256": "0pidsbgn9hnwmz896j0x6y550k37i3kmg391yp7qj4m2dns3n5w2"
}