Remove identicons, replace them with initials of a user (#15815)

* Remove identicon, replace it with initials of a user

* Lint fix
This commit is contained in:
Alexander 2023-05-11 10:05:20 +02:00 committed by GitHub
parent 13a1ee7479
commit ce322c9537
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
47 changed files with 138 additions and 292 deletions

View File

@ -1,10 +0,0 @@
(ns native-module.core-test
(:require [cljs.test :refer [deftest is testing]]
[native-module.core :as native-module]))
(deftest identicon-test
(testing "check if identicon test works"
(is
(=
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAjklEQVR4nOzXsQmAMBQGYRV3cUAdQwd0Gm2sJIWSBI6f+0oR8XjwSKYhhCE0htAYQmMITUzI/PXF49yv0vN12cYWP1L7/ZiJGEJjCE31xvm7bXptv5iJGEJjCE31WasVz1oPQ2gMoWlyuyvpfaN8i5mIITSG0BhCYwiNIeokZiKG0BhCYwiNITR3AAAA//+A3RtWaKqXgQAAAABJRU5ErkJggg=="
(native-module/identicon "a")))))

View File

@ -12,12 +12,6 @@
(colors/theme-colors colors/neutral-80-opa-5 colors/white-opa-5 override-theme)
(colors/theme-colors colors/neutral-10 colors/neutral-90 override-theme))})
(def context-tag-image
{:width 20
:border-radius 10
:background-color :white
:height 20})
(defn context-tag-icon-color
[blur?]
(if blur?

View File

@ -1,5 +1,6 @@
(ns quo2.components.tags.context-tag.view
(:require [quo2.components.avatars.group-avatar :as group-avatar]
(:require [quo2.components.avatars.user-avatar.view :as user-avatar]
[quo2.components.avatars.group-avatar :as group-avatar]
[quo2.components.icon :as icons]
[quo2.components.markdown.text :as text]
[quo2.components.tags.context-tag.style :as style]
@ -43,9 +44,11 @@
:size :paragraph-2
:style (assoc text-style :justify-content :center)}]
[base-tag (assoc-in params [:style :padding-left] 3)
[rn/image
{:style style/context-tag-image
:source photo}]
[user-avatar/user-avatar
{:full-name name
:profile-picture photo
:size :xxs
:status-indicator? false}]
[rn/view {:style style/context-tag-text-container}
[text/text text-params (str " " name)]
(when channel-name
@ -58,7 +61,7 @@
(defn user-avatar-tag
[params username photo]
[context-tag params {:uri photo} username])
[context-tag params photo username])
(defn audio-tag
[duration params]

View File

@ -20,7 +20,6 @@
:clock clock-value
:alias "alias"
:name "name"
:identicon "identicon"
:from "from"}]
;; <- cursor
;; <- message
@ -107,7 +106,6 @@
:clock (- clock-value 2)
:alias "alias"
:name "name"
:identicon "identicon"
:from "from"}
result (dissoc (message/receive-many
cofx

View File

@ -3,8 +3,7 @@
[clojure.string :as string]
[status-im2.constants :as constants]
[status-im.ethereum.core :as ethereum]
[status-im.utils.gfycat.core :as gfycat]
[status-im.utils.identicon :as identicon]))
[status-im.utils.gfycat.core :as gfycat]))
(defn public-key->new-contact
[public-key]
@ -12,7 +11,6 @@
{:alias alias
:name alias
:primary-name alias
:identicon (identicon/identicon public-key)
:public-key public-key}))
(defn public-key-and-ens-name->new-contact
@ -59,7 +57,7 @@
[members admins contacts {:keys [public-key preferred-name name] :as current-account}]
(let [current-contact (some->
current-account
(select-keys [:name :preferred-name :public-key :identicon :images])
(select-keys [:name :preferred-name :public-key :images])
(set/rename-keys {:name :alias :preferred-name :name})
(assoc :primary-name (or preferred-name name)))
all-contacts (cond-> contacts

View File

@ -1,13 +1,11 @@
(ns status-im.contact.db-test
(:require [cljs.test :refer-macros [deftest is testing]]
[status-im.contact.db :as contact.db]
[status-im.utils.gfycat.core :as gfycat]
[status-im.utils.identicon :as identicon]))
[status-im.utils.gfycat.core :as gfycat]))
(deftest contacts-subs
(testing "get-all-contacts-in-group-chat"
(with-redefs [gfycat/generate-gfy (constantly "generated")
identicon/identicon (constantly "generated")]
(with-redefs [gfycat/generate-gfy (constantly "generated")]
(let
[chat-contact-ids
#{"0x04fcf40c526b09ff9fb22f4a5dbd08490ef9b64af700870f8a0ba2133f4251d5607ed83cd9047b8c2796576bc83fa0de23a13a4dced07654b8ff137fe744047917"
@ -21,7 +19,6 @@
{:last-updated 0
:name "User B"
:primary-name "User B"
:identicon "photo1"
:last-online 0
:public-key
"0x04985040682b77a32bb4bb58268a0719bd24ca4d07c255153fe1eb2ccd5883669627bd1a092d7cc76e8e4b9104327667b19dcda3ac469f572efabe588c38c1985f"}}
@ -31,7 +28,6 @@
:sharing-usage-data? false
:primary-name "User A"
:name "User A"
:identicon "photo2"
:public-key
"0x048a2f8b80c60f89a91b4c1316e56f75b087f446e7b8701ceca06a40142d8efe1f5aa36bd0fee9e248060a8d5207b43ae98bef4617c18c71e66f920f324869c09f"}]
(is
@ -42,20 +38,17 @@
current-multiaccount)
[{:name "generated"
:primary-name "generated"
:identicon "generated"
:alias "generated"
:admin? true
:public-key
"0x04fcf40c526b09ff9fb22f4a5dbd08490ef9b64af700870f8a0ba2133f4251d5607ed83cd9047b8c2796576bc83fa0de23a13a4dced07654b8ff137fe744047917"}
{:alias "User A"
:primary-name "User A"
:identicon "photo2"
:public-key
"0x048a2f8b80c60f89a91b4c1316e56f75b087f446e7b8701ceca06a40142d8efe1f5aa36bd0fee9e248060a8d5207b43ae98bef4617c18c71e66f920f324869c09f"}
{:last-updated 0
:name "User B"
:primary-name "User B"
:identicon "photo1"
:last-online 0
:public-key
"0x04985040682b77a32bb4bb58268a0719bd24ca4d07c255153fe1eb2ccd5883669627bd1a092d7cc76e8e4b9104327667b19dcda3ac469f572efabe588c38c1985f"}]))))))

View File

@ -79,7 +79,6 @@
:emoji (.-emoji chat)
:timestamp (.-timestamp chat)
:alias (.-alias chat)
:identicon (.-identicon chat)
:muted (.-muted chat)
:joined (.-joined chat)
:muted-till (.-mutetill chat)

View File

@ -108,11 +108,6 @@
[_]
{:dismiss-keyboard nil})
(rf/defn identicon-generated
{:events [:identicon-generated]}
[{:keys [db]} path identicon]
{:db (assoc-in db path identicon)})
(rf/defn gfycat-generated
{:events [:gfycat-generated]}
[{:keys [db]} path gfycat]

View File

@ -339,11 +339,10 @@
(let [{:keys [key-uid encryption-public-key whisper-private-key]
:as account-data}
(js->clj data :keywordize-keys true)
{:keys [identicon name]} (get-in db [:multiaccounts/multiaccounts key-uid])
{:keys [name]} (get-in db [:multiaccounts/multiaccounts key-uid])
key-uid (get-in db [:keycard :application-info :key-uid])
multiaccount-data (types/clj->json {:name name
:key-uid key-uid
:identicon identicon})
multiaccount-data (types/clj->json {:name name
:key-uid key-uid})
save-keys? (get-in db [:multiaccounts/login :save-password?])]
(rf/merge cofx
{:db
@ -360,7 +359,6 @@
(update :multiaccounts/login assoc
:password encryption-public-key
:key-uid key-uid
:identicon identicon
:name name))
:keycard/login-with-keycard {:multiaccount-data multiaccount-data

View File

@ -200,7 +200,7 @@
(.remove listener)))
(re-frame/reg-fx
:keycard/generate-name-and-photo
:keycard/generate-name
(fn [{:keys [public-key on-success]}]
(native-module/gfycat-identicon-async
public-key

View File

@ -151,13 +151,12 @@
:multiaccounts-stack
[:multiaccounts
:keycard-login-pin])
(let [{:keys [identicon name]} (get-in db [:multiaccounts/multiaccounts key-uid])
multiaccount-data (types/clj->json {:name name
:key-uid key-uid
:identicon identicon})
account-data {:key-uid key-uid
:encryption-public-key encryption-public-key
:whisper-private-key whisper-private-key}]
(let [{:keys [name]} (get-in db [:multiaccounts/multiaccounts key-uid])
multiaccount-data (types/clj->json {:name name
:key-uid key-uid})
account-data {:key-uid key-uid
:encryption-public-key encryption-public-key
:whisper-private-key whisper-private-key}]
{:db
(-> db
(assoc-in [:keycard :pin :status] nil)
@ -168,7 +167,6 @@
(update :multiaccounts/login assoc
:password encryption-public-key
:key-uid key-uid
:identicon identicon
:name name
:save-password? true))
:keycard/login-with-keycard

View File

@ -160,7 +160,6 @@
(let [{{:keys [multiaccount secrets flow]} :keycard} db
{:keys [address
name
identicon
public-key
whisper-public-key
wallet-public-key
@ -175,18 +174,17 @@
recovered]}
multiaccount
{:keys [pairing paired-on]} secrets
{:keys [name identicon]}
{:keys [name]}
(if (nil? name)
;; name might have been generated during recovery via passphrase
(get-in db [:intro-wizard :derived constants/path-whisper-keyword])
{:name name
:identicon identicon})]
{:name name})]
;; if a name is still `nil` we have to generate it before multiaccount's
;; creation otherwise spec validation will fail
(if (nil? name)
{:keycard/generate-name-and-photo
{:keycard/generate-name
{:public-key whisper-public-key
:on-success ::on-name-and-photo-generated}}
:on-success ::on-name-generated}}
(rf/merge cofx
{:db (-> db
(assoc-in [:keycard :setup-step] nil)
@ -199,8 +197,7 @@
constants/path-whisper-keyword
{:public-key whisper-public-key
:address (eip55/address->checksum whisper-address)
:name name
:identicon identicon}
:name name}
constants/path-default-wallet-keyword
{:public-key wallet-public-key
:address (eip55/address->checksum wallet-address)}}
@ -382,11 +379,11 @@
{:on-card-connected :keycard/load-recovering-key-screen
:handler (common/dispatch-event :keycard/import-multiaccount)}))
(rf/defn on-name-and-photo-generated
{:events [::on-name-and-photo-generated]
(rf/defn on-name-generated
{:events [::on-name-generated]
:interceptors [(re-frame/inject-cofx :random-guid-generator)
(re-frame/inject-cofx ::multiaccounts.create/get-signing-phrase)]}
[{:keys [db] :as cofx} whisper-name identicon]
[{:keys [db] :as cofx} whisper-name]
(rf/merge
cofx
{:db (update-in db
@ -394,6 +391,5 @@
(fn [multiacc]
(assoc multiacc
:recovered (get db :recovered-account?)
:name whisper-name
:identicon identicon)))}
:name whisper-name)))}
(create-keycard-multiaccount)))

View File

@ -268,12 +268,9 @@
public-key (get-in derived-data [constants/path-whisper-keyword :public-key])]
(native-module/gfycat-identicon-async
public-key
(fn [name photo-path]
(fn [name _]
(let [derived-data-extended
(update derived-data
constants/path-whisper-keyword
merge
{:name name :identicon photo-path})]
(update derived-data constants/path-whisper-keyword assoc :name name)]
(reset! derived-acc
{:root-key root-data
:derived derived-data-extended})))))))))))

View File

@ -9,7 +9,6 @@
[quo2.foundations.colors :as colors]
[status-im2.constants :as constants]
[status-im.utils.gfycat.core :as gfycat]
[status-im.utils.identicon :as identicon]
[status-im2.setup.hot-reload :as hot-reload]
[status-im2.common.theme.core :as theme]
[taoensso.timbre :as log]
@ -48,23 +47,11 @@
(gfycat/generate-gfy identity))]
[(:primary-name contact) (:secondary-name contact)])))
(def photo-quality-thumbnail :thumbnail)
(def photo-quality-large :large)
(defn displayed-photo
"If a photo, a image or an images array is set use it, otherwise fallback on identicon or generate"
[{:keys [images identicon public-key]}]
(cond
(pos? (count images))
(:uri (or (photo-quality-thumbnail images)
(photo-quality-large images)
(first images)))
(not (string/blank? identicon))
identicon
:else
(identicon/identicon public-key)))
[{:keys [images]}]
(or (:thumbnail images)
(:large images)
(first images)))
(re-frame/reg-fx
::webview-debug-changed

View File

@ -71,11 +71,11 @@
public-key (get-in derived-data [constants/path-whisper-keyword :public-key])]
(native-module/gfycat-identicon-async
public-key
(fn [name identicon]
(fn [name _]
(let [derived-whisper (derived-data constants/path-whisper-keyword)
derived-data-extended (assoc-in derived-data
[constants/path-whisper-keyword]
(merge derived-whisper {:name name :identicon identicon}))]
(assoc derived-whisper :name name))]
(re-frame/dispatch [::store-multiaccount-success key-code derived-data-extended]))))))]}))
(re-frame/reg-fx
@ -154,13 +154,12 @@
:wallet true
:path constants/path-default-wallet
:name (i18n/label :t/main-account)})
(let [{:keys [compressed-key public-key address name identicon]}
(let [{:keys [compressed-key public-key address name]}
(get-in multiaccount [:derived constants/path-whisper-keyword])]
{:public-key public-key
:compressed-key compressed-key
:address (eip55/address->checksum address)
:name name
:identicon identicon
:path constants/path-whisper
:chat true})])
@ -174,13 +173,11 @@
(let [[wallet-account
{:keys [public-key
compressed-key
identicon
name]} :as accounts-data]
(prepare-accounts-data
multiaccount)
multiaccount-data {:name name
:address address
:identicon identicon
:key-uid key-uid
:keycard-pairing keycard-pairing}
keycard-multiaccount? (boolean keycard-pairing)
@ -202,7 +199,6 @@
constants/path-wallet-root-keyword
:address])
:name name
:identicon identicon
;; public key of the chat account
:public-key public-key
;; compressed key of the chat account
@ -231,7 +227,6 @@
db (assoc db
:multiaccounts/login {:key-uid key-uid
:name name
:identicon identicon
:password password
:creating? true
:processing true}

View File

@ -168,25 +168,23 @@
(rf/defn login
{:events [:multiaccounts.login.ui/password-input-submitted]}
[{:keys [db]}]
(let [{:keys [key-uid password name identicon]} (:multiaccounts/login db)]
(let [{:keys [key-uid password name]} (:multiaccounts/login db)]
{:db (-> db
(assoc-in [:multiaccounts/login :processing] true)
(dissoc :intro-wizard :recovered-account?)
(update :keycard dissoc :flow))
::login [key-uid
(types/clj->json {:name name
:key-uid key-uid
:identicon identicon})
(types/clj->json {:name name
:key-uid key-uid})
(ethereum/sha3 (security/safe-unmask-data password))]}))
(rf/defn export-db-submitted
{:events [:multiaccounts.login.ui/export-db-submitted]}
[{:keys [db]}]
(let [{:keys [key-uid password name identicon]} (:multiaccounts/login db)]
(let [{:keys [key-uid password name]} (:multiaccounts/login db)]
{::export-db [key-uid
(types/clj->json {:name name
:key-uid key-uid
:identicon identicon})
(types/clj->json {:name name
:key-uid key-uid})
(ethereum/sha3 (security/safe-unmask-data password))
(fn [path]
(when platform/ios?
@ -198,11 +196,10 @@
(rf/defn import-db-submitted
{:events [:multiaccounts.login.ui/import-db-submitted]}
[{:keys [db]}]
(let [{:keys [key-uid password name identicon]} (:multiaccounts/login db)]
(let [{:keys [key-uid password name]} (:multiaccounts/login db)]
{::import-db [key-uid
(types/clj->json {:name name
:key-uid key-uid
:identicon identicon})
(types/clj->json {:name name
:key-uid key-uid})
(ethereum/sha3 (security/safe-unmask-data password))]}))
(rf/defn finish-keycard-setup
@ -742,7 +739,7 @@
(merge
{:db (update db :keycard dissoc :application-info)}
(when keycard-multiaccount? {:navigate-to :keycard-login-pin}))
(open-login (select-keys multiaccount [:key-uid :name :public-key :identicon :images])))))
(open-login (select-keys multiaccount [:key-uid :name :public-key :images])))))
(rf/defn hide-keycard-banner
{:events [:hide-keycard-banner]}

View File

@ -5,8 +5,6 @@
:tags #{}
:address "2f88d65f3cb52605a54a833ae118fb1363acccd2"
:name "Darkviolet Lightgreen Halcyon"
:identicon
"data:image/png;base64iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAADAFBMVEX///+M2KwAAAAAAAAAAAAAAAA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AQEAAAAAAQEBAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQEBAQEBAAAAAAEBAQEBAQEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEAAAAAAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEBAQEBAQAAAAABAQEBAQEBAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQEBAQEBAAAAAAEBAQEBAQEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAloYA4a9rBHIAAAAASUVORK5CYII="
:wallet-set-up-passed? false
:public-key
"0x04173f7cdea0076a7998abb674cc79fe61337c42db77043c01d5b0f3e3ac1e5a45bca0c93bb9f3c3d38b7cc9a7337cd64f9f9b2114fe4bbdfe1ae2633ba14d8c9c"

View File

@ -10,14 +10,13 @@
(deftest on-password-input-submitted
(testing
"handling :multiaccounts.login.ui/password-input-submitted event"
(let [cofx {:db {:multiaccounts/login {:key-uid "key-uid"
:password "password"
:name "user"
:identicon "photo"}}}
(let [cofx {:db {:multiaccounts/login {:key-uid "key-uid"
:password "password"
:name "user"}}}
efx (login.core/login cofx)]
(testing "Change multiaccount."
(is (= (::login.core/login efx)
["key-uid" "{\"name\":\"user\",\"key-uid\":\"key-uid\",\"identicon\":\"photo\"}"
["key-uid" "{\"name\":\"user\",\"key-uid\":\"key-uid\"}"
(ethereum/sha3 "password")])))
(testing "start activity indicator"
(is (= (get-in efx [:db :multiaccounts/login :processing]) true))))))

View File

@ -108,12 +108,9 @@
public-key (get-in derived-data [constants/path-whisper-keyword :public-key])]
(native-module/gfycat-identicon-async
public-key
(fn [name identicon]
(fn [name _]
(let [derived-data-extended
(update derived-data
constants/path-whisper-keyword
merge
{:name name :identicon identicon})]
(update derived-data constants/path-whisper-keyword assoc :name name)]
(re-frame/dispatch [success-event root-data derived-data-extended]))))))))))))
(rf/defn show-existing-multiaccount-alert

View File

@ -195,10 +195,10 @@
(rf/defn send-installation-messages
{:events [:pairing.ui/synchronize-installation-pressed]}
[{:keys [db]}]
(let [multiaccount (:multiaccount db)
{:keys [name preferred-name identicon]} multiaccount]
(let [multiaccount (:multiaccount db)
{:keys [name preferred-name]} multiaccount]
{:json-rpc/call [{:method "wakuext_syncDevices"
:params [(or preferred-name name) identicon]
:params [(or preferred-name name)]
:on-success #(log/debug "successfully synced devices")}]}))
(defn installation<-rpc

View File

@ -2,6 +2,7 @@
(:require [clojure.string :as string]
[quo.design-system.colors :as colors]
[quo.react-native :as rn]
[quo2.core :as quo]
[re-frame.core :as re-frame.core]
[status-im.multiaccounts.core :as multiaccounts]
[status-im.ui.components.chat-icon.styles :as styles]
@ -47,19 +48,13 @@
(defn profile-photo-plus-dot-view
[{:keys [public-key photo-container photo-path community?]}]
(let [photo-path (if (nil? photo-path)
@(re-frame.core/subscribe [:chats/photo-path public-key])
photo-path)
photo-container (if (nil? photo-container)
(let [photo-container (if (nil? photo-container)
styles/container-chat-list
photo-container)
size (:width photo-container)
identicon? (and photo-path
(string/starts-with? photo-path "data:image/png;base64,"))
dot-styles (visibility-status-utils/icon-visibility-status-dot
public-key
size
identicon?)
size)
dot-accessibility-label (:accessibility-label dot-styles)]
[rn/view
{:style photo-container
@ -147,9 +142,13 @@
[photos/photo (multiaccounts/displayed-photo contact) styles]])
(defn contact-icon-contacts-tab
[photo-path]
[{:keys [primary-name] :as contact}]
[rn/view styles/container-chat-list
[photos/photo photo-path {:size 40}]])
[quo/user-avatar
{:full-name primary-name
:profile-picture (multiaccounts/displayed-photo contact)
:size :small
:status-indicator? false}]])
(defn dapp-icon-permission
[contact size]
@ -195,9 +194,10 @@
:public-key public-key
:photo-container (:container styles)
:community? community?}]
(if (string/blank? emoji)
[default-chat-icon name styles]
[emoji-chat-icon emoji styles]))
[rn/view {:accessibility-label :chat-icon}
(if (string/blank? emoji)
[default-chat-icon name styles]
[emoji-chat-icon emoji styles])])
(when edit?
[rn/view {:style (styles/chat-icon-profile-edit)}
[icons/tiny-icon :tiny-icons/tiny-edit {:color colors/white-persist}]])]))

View File

@ -1,7 +1,5 @@
(ns status-im.ui.screens.chat.photos
(:require [quo.design-system.colors :as colors]
[re-frame.core :as re-frame]
[status-im.multiaccounts.core :as multiaccounts]
[status-im.ui.components.fast-image :as fast-image]
[status-im.ui.components.react :as react]
[status-im.ui.screens.chat.styles.photos :as style]))
@ -11,32 +9,14 @@
(fn [photo-path size accessibility-label _]
[react/view {:style (style/photo-container size)}
[fast-image/fast-image
{:source {:uri photo-path}
{:source photo-path
:style (style/photo size)
:accessibility-label (or accessibility-label :chat-icon)}]
[react/view {:style (style/photo-border size)}]])))
;; "(colors/dark?)" is passed to memoized function to avoid previous themes cache
;; TODO: it's only used for old code, `quo/user-avatar` should be used instead for all the new one
(defn photo
^:deprecated
[photo-path {:keys [size accessibility-label]}]
[memo-photo-rend photo-path size accessibility-label (colors/dark?)])
;; We optionally pass identicon for perfomance reason, so it does not have to be calculated for each
;; message
(defn member-photo
([pub-key]
(member-photo pub-key nil))
([pub-key identicon]
(member-photo pub-key identicon style/default-size))
([pub-key identicon size]
(let [path @(re-frame/subscribe [:chats/photo-path pub-key identicon])]
[photo path
{:size size
:accessibility-label :member-photo}])))
(defn account-photo
[account]
(let [path (multiaccounts/displayed-photo account)]
[photo path
{:size style/default-size
:accessibility-label :own-account-photo}]))

View File

@ -14,13 +14,12 @@
(defn one-to-one-chat-accents
[chat-id]
(let [photo @(re-frame/subscribe [:chats/photo-path chat-id])
contact-name @(re-frame/subscribe [:contacts/contact-name-by-identity chat-id])]
(let [{:keys [primary-name] :as contact} @(re-frame/subscribe [:contacts/contact-by-identity chat-id])]
[react/view
[quo/list-item
{:theme :accent
:icon [chat-icon/contact-icon-contacts-tab photo]
:title contact-name
:icon [chat-icon/contact-icon-contacts-tab contact]
:title primary-name
:subtitle (i18n/label :t/view-profile)
:accessibility-label :view-chat-details-button
:chevron true

View File

@ -6,7 +6,6 @@
[status-im.communities.core :as communities]
[status-im2.constants :as constants]
[utils.i18n :as i18n]
[status-im.multiaccounts.core :as multiaccounts]
[status-im.ui.components.chat-icon.screen :as chat-icon.screen]
[status-im.ui.components.toolbar :as toolbar]
[status-im.ui.components.topbar :as topbar]
@ -34,8 +33,7 @@
[quo/list-item
{:title primary-name
:subtitle secondary-name
:icon [chat-icon.screen/contact-icon-contacts-tab
(multiaccounts/displayed-photo contact)]
:icon [chat-icon.screen/contact-icon-contacts-tab contact]
:accessory :checkbox
:active active
:on-press (fn []

View File

@ -22,8 +22,7 @@
[:<>
[quo/list-item
{:theme :accent
:icon [chat-icon/contact-icon-contacts-tab
(multiaccounts/displayed-photo member)]
:icon [chat-icon/contact-icon-contacts-tab member]
:title primary-name
:subtitle (i18n/label :t/view-profile)
:accessibility-label :view-chat-details-button

View File

@ -46,8 +46,7 @@
{:flex-basis 120})
:accessory (when can-manage-users?
[request-actions community-id id])
:icon [chat-icon/contact-icon-contacts-tab
(multiaccounts/displayed-photo member)]
:icon [chat-icon/contact-icon-contacts-tab member]
:on-press #(re-frame/dispatch [:chat.ui/show-profile public-key])}]))
(defn requests-to-join

View File

@ -5,7 +5,6 @@
[reagent.core :as reagent]
[status-im2.constants :as constants]
[utils.i18n :as i18n]
[status-im.multiaccounts.core :as multiaccounts]
[status-im.ui.components.chat-icon.screen :as chat-icon]
[status-im.ui.components.invite.views :as invite]
[status-im.ui.components.keyboard-avoid-presentation :as kb-presentation]
@ -24,8 +23,7 @@
[quo/list-item
{:title primary-name
:subtitle secondary-name
:icon [chat-icon/contact-icon-contacts-tab
(multiaccounts/displayed-photo row)]}]))
:icon [chat-icon/contact-icon-contacts-tab row]}]))
(defn- on-toggle
[allow-new-users? checked? public-key]
@ -59,8 +57,7 @@
[quo/list-item
{:title primary-name
:subtitle secondary-name
:icon [chat-icon/contact-icon-contacts-tab
(multiaccounts/displayed-photo contact)]
:icon [chat-icon/contact-icon-contacts-tab contact]
:on-press #(on-toggle allow-new-users? contact-selected? public-key)
:active contact-selected?
:accessory :checkbox}])))

View File

@ -205,10 +205,8 @@
[_ _]
(reagent/create-class
{:should-component-update
(fn [_ [_ old-account] [_ new-account]]
(and (not (nil? new-account))
(and (not (:identicon old-account))
(nil? (:identicon new-account)))))
(fn [_ [_ _] [_ new-account]]
(not (nil? new-account)))
:reagent-render
(fn [account small-screen?]

View File

@ -5,7 +5,6 @@
[re-frame.core :as re-frame]
[re-frame.db]
[utils.i18n :as i18n]
[status-im.multiaccounts.core :as multiaccounts]
[status-im.multiaccounts.key-storage.core :as multiaccounts.key-storage]
[status-im.react-native.resources :as resources]
[status-im.ui.components.accordion :as accordion]
@ -68,8 +67,7 @@
[local-topbar (i18n/label :t/choose-actions)]
[accordion/section
{:title name
:icon [chat-icon.screen/contact-icon-contacts-tab
(multiaccounts/displayed-photo multiaccount)]
:icon [chat-icon.screen/contact-icon-contacts-tab multiaccount]
:content [accordion-content]}]
[react/view
{:flex 1

View File

@ -17,8 +17,7 @@
(letsubs [{:keys [pubkey
processing?
compressed-key
name
identicon]}
name]}
[:intro-wizard/recovery-success]
existing-account? [:intro-wizard/recover-existing-account?]]
[react/view
@ -44,14 +43,7 @@
[react/view
{:justify-content :center
:align-items :center
:margin-bottom 11}
[react/image
{:source {:uri identicon}
:style {:width 61
:height 61
:border-radius 30
:border-width 1
:border-color colors/black-transparent}}]]
:margin-bottom 11}]
[react/text
{:style {:text-align :center
:color colors/black

View File

@ -46,8 +46,7 @@
(i18n/label :t/delete-profile)]]
[quo/list-item
{:title (multiaccounts/displayed-name multiaccount)
:icon [chat-icon.screen/contact-icon-contacts-tab
(multiaccounts/displayed-photo multiaccount)]}]
:icon [chat-icon.screen/contact-icon-contacts-tab multiaccount]}]
(when keycard?
[react/view
[quo/list-header (i18n/label :t/actions)]

View File

@ -23,8 +23,7 @@
[react/view
[quo/list-item
{:theme :accent
:icon [chat-icon/contact-icon-contacts-tab
(multiaccounts/displayed-photo member)]
:icon [chat-icon/contact-icon-contacts-tab member]
:title (:primary-name member)
:subtitle (i18n/label :t/view-profile)
:accessibility-label :view-chat-details-button
@ -59,8 +58,7 @@
{:title primary-name
:subtitle secondary-name
:accessibility-label :member-item
:icon [chat-icon/contact-icon-contacts-tab
(multiaccounts/displayed-photo member)]
:icon [chat-icon/contact-icon-contacts-tab member]
:on-press (when (not= public-key current-user-identity)
#(re-frame/dispatch [:chat.ui/show-profile public-key]))}
(when (:admin? member)
@ -140,8 +138,7 @@
(let [contact (or @(re-frame/subscribe [:contacts/contact-by-identity from]) {:public-key from})]
[quo/list-item
{:title (multiaccounts/displayed-name contact)
:icon [chat-icon/contact-icon-contacts-tab
(multiaccounts/displayed-photo contact)]
:icon [chat-icon/contact-icon-contacts-tab contact]
:on-press #(re-frame/dispatch [:bottom-sheet/show-sheet-old
{:content (fn []
[invitation-sheet invitation contact])}])}]))

View File

@ -94,20 +94,16 @@
:online-profile-photo-dot
:offline-profile-photo-dot))
(defn icon-dot-margin
[_ _]
-2)
(defn icon-dot-size
[container-size]
(/ container-size 2.4))
(defn icon-visibility-status-dot
[public-key container-size identicon?]
[public-key container-size]
(let [my-icon? (my-icon? public-key)
visibility-status-update (visibility-status-update public-key my-icon?)
size (icon-dot-size container-size)
margin (icon-dot-margin size identicon?)
margin -2
dot-color (icon-dot-color visibility-status-update)
new-ui? true]
(merge (styles/visibility-status-dot {:color dot-color

View File

@ -7,7 +7,6 @@
[status-im.ethereum.core :as ethereum]
[status-im.ethereum.stateofus :as stateofus]
[utils.i18n :as i18n]
[status-im.multiaccounts.core :as multiaccounts]
[status-im.ui.components.chat-icon.screen :as chat-icon]
[status-im.ui.components.icons.icons :as icons]
[status-im.ui.components.keyboard-avoid-presentation :as kb-presentation]
@ -98,8 +97,7 @@
(some-> ^js @scroll-view-ref
(.scrollTo #js {:x 0 :animated true}))
(re-frame/dispatch [:wallet.recipient/address-changed name]))
:icon [chat-icon/contact-icon-contacts-tab
(multiaccounts/displayed-photo contact)]}])
:icon [chat-icon/contact-icon-contacts-tab contact]}])
(defn empty-items
[icon title]

View File

@ -83,8 +83,7 @@
{:monospace true
:color :secondary}
(utils/get-shortened-checksum-address (:address contact))]
:icon [chat-icon/contact-icon-contacts-tab
(multiaccounts/displayed-photo contact)]}]
:icon [chat-icon/contact-icon-contacts-tab contact]}]
[quo/list-item
(merge {:title (if-not contact
(i18n/label :t/wallet-choose-recipient)

View File

@ -3,12 +3,10 @@
[re-frame.core :as re-frame]
[status-im.router.core :as router]
[status-im.utils.gfycat.core :as gfycat]
[status-im.utils.identicon :as identicon]
[status-im.utils.universal-links.core :as links]))
(deftest handle-url-test
(with-redefs [gfycat/generate-gfy (constantly "generated")
identicon/identicon (constantly "generated")]
(with-redefs [gfycat/generate-gfy (constantly "generated")]
(testing "the user is not logged in"
(testing "it stores the url for later processing"
(is (= {:db {:universal-links/url "some-url"}}

View File

@ -30,19 +30,19 @@
close-button-text]}]
(let [extra-action-selected? (reagent/atom false)]
(fn []
(let [{:keys [group-chat chat-id public-key color profile-picture
name]} context
id (or chat-id public-key)
display-name (or
name
(when-not group-chat
(rf/sub [:contacts/contact-name-by-identity id])))
contact (when-not group-chat
(rf/sub [:contacts/contact-by-address
id]))
photo-path (or profile-picture
(when-not (empty? (:images contact))
(rf/sub [:chats/photo-path id])))]
(let [{:keys [group-chat chat-id public-key color
profile-picture name]} context
id (or chat-id public-key)
display-name (or
name
(when-not group-chat
(rf/sub [:contacts/contact-name-by-identity id])))
contact (when-not group-chat
(rf/sub [:contacts/contact-by-address
id]))
photo-path (or profile-picture
(when-not (empty? (:images contact))
(rf/sub [:chats/photo-path id])))]
[rn/view
{:style {:margin-horizontal 20}
:accessibility-label accessibility-label}

View File

@ -17,14 +17,14 @@
(defn user-avatar-tag
[user-id]
(let [contact (rf/sub [:contacts/contact-by-identity user-id])]
(let [{:keys [primary-name] :as contact} (rf/sub [:contacts/contact-by-identity user-id])]
[quo/user-avatar-tag
{:color :purple
:override-theme :dark
:size :small
:style style/user-avatar-tag
:text-style style/user-avatar-tag-text}
(:primary-name contact)
primary-name
(multiaccounts/displayed-photo contact)]))
(defn- render-swipe-action

View File

@ -5,6 +5,7 @@
[react-native.core :as rn]
[react-native.clipboard :as clipboard]
[reagent.core :as reagent]
[status-im.multiaccounts.core :as multiaccounts]
[status-im.qr-scanner.core :as qr-scanner]
[status-im.utils.utils :as utils]
[status-im2.contexts.add-new-contact.style :as style]
@ -14,12 +15,8 @@
(defn found-contact
[public-key]
(let [{:keys [primary-name
compressed-key
identicon
images]} (rf/sub [:contacts/contact-by-identity public-key])
profile-picture (-> (or (:thumbnail images) (:large images) (first images))
(get :uri identicon))]
(let [{:keys [primary-name compressed-key]
:as contact} (rf/sub [:contacts/contact-by-identity public-key])]
(when primary-name
[rn/view style/found-user
[quo/text (style/text-description)
@ -27,7 +24,7 @@
[rn/view (style/found-user-container)
[quo/user-avatar
{:full-name primary-name
:profile-picture profile-picture
:profile-picture (multiaccounts/displayed-photo contact)
:size :small
:status-indicator? false}]
[rn/view style/found-user-text

View File

@ -79,7 +79,7 @@
(format-reply-author from contact-name current-public-key)]]))
(defn quoted-message
[{:keys [from identicon content-type contentType parsed-text content deleted? deleted-for-me?
[{:keys [from content-type contentType parsed-text content deleted? deleted-for-me?
album-images-count]}
in-chat-input? pin? recording-audio?]
(let [contact-name (rf/sub [:contacts/contact-name-by-identity from])
@ -100,7 +100,6 @@
[rn/view {:style (style/quoted-message pin?)}
[reply-from
{:from from
:identicon identicon
:contact-name contact-name
:current-public-key current-public-key}]
[quo/text

View File

@ -15,7 +15,6 @@
:secondary-name (.-secondaryName js-contact)
:ens-name (.-name js-contact)
:nickname (.-localNickname js-contact)
:identicon (oops/oget js-contact "identicon")
:images (types/js->clj (oops/oget js-contact "images"))
:ens-verified (oops/oget js-contact "ensVerified")
:contact-request-state (oops/oget js-contact "contactRequestState")

View File

@ -43,7 +43,7 @@
(rf/merge cofx
(multiaccounts.login/open-login (select-keys
multiaccount
[:key-uid :name :public-key :identicon :images]))
[:key-uid :name :public-key :images]))
(keychain/get-auth-method (:key-uid multiaccount))))
(navigation/init-root cofx :intro))))

View File

@ -6,10 +6,8 @@
[status-im.group-chats.core :as group-chat]
[status-im.group-chats.db :as group-chats.db]
[status-im.multiaccounts.core :as multiaccounts]
[utils.image-server :as image-server]
[status-im2.constants :as constants]
[status-im2.contexts.chat.events :as chat.events]
[quo2.theme :as theme]))
[status-im2.contexts.chat.events :as chat.events]))
(re-frame/reg-sub
:chats/chat
@ -282,13 +280,9 @@
:<- [:contacts/contacts]
:<- [:profile/multiaccount]
:<- [:mediaserver/port]
(fn [[contacts {:keys [public-key] :as multiaccount} port] [_ id]]
(let [contact (or (when (= id public-key)
multiaccount)
(get contacts id))]
(if (nil? contact)
(image-server/get-identicons-uri port id (theme/get-theme))
(multiaccounts/displayed-photo contact)))))
(fn [[contacts {:keys [public-key] :as multiaccount}] [_ id]]
(multiaccounts/displayed-photo (or (when (= id public-key) multiaccount)
(get contacts id)))))
(re-frame/reg-sub
:chats/unread-messages-number

View File

@ -34,7 +34,6 @@
(defn- replace-contact-image-uri
[contact port identity]
(let [theme (theme/get-theme)
identicon (image-server/get-identicons-uri port identity theme)
contact-images (:images contact)
contact-images (reduce (fn [acc image]
(let [image-name (:type image)
@ -49,7 +48,7 @@
(assoc-in acc [(keyword image-name) :uri] uri)))
contact-images
(vals contact-images))]
(assoc contact :identicon identicon :images contact-images)))
(assoc contact :images contact-images)))
(defn- reduce-contacts-image-uri
[contacts port]

View File

@ -19,7 +19,7 @@
:multiaccount/contact
:<- [:multiaccount]
(fn [current-account]
(select-keys current-account [:name :preferred-name :public-key :identicon :image :images])))
(select-keys current-account [:name :preferred-name :public-key :image :images])))
(re-frame/reg-sub
:multiaccount/preferred-name
@ -208,22 +208,20 @@
(defn- replace-multiaccount-image-uri
[multiaccount port]
(let [public-key (:public-key multiaccount)
theme (theme/get-theme)
identicon (image-server/get-identicons-uri port public-key theme)
multiaccount (assoc multiaccount :identicon identicon)
images (:images multiaccount)
images (reduce (fn [acc current]
(let [key-uid (:keyUid current)
image-name (:type current)
uri (image-server/get-account-image-uri port
public-key
image-name
key-uid
theme)]
(conj acc (assoc current :uri uri))))
[]
images)]
(let [public-key (:public-key multiaccount)
theme (theme/get-theme)
images (:images multiaccount)
images (reduce (fn [acc current]
(let [key-uid (:keyUid current)
image-name (:type current)
uri (image-server/get-account-image-uri port
public-key
image-name
key-uid
theme)]
(conj acc (assoc current :uri uri))))
[]
images)]
(assoc multiaccount :images images)))
(re-frame/reg-sub

View File

@ -39,7 +39,6 @@
{:pubkey (get-in wizard-state [:derived constants/path-whisper-keyword :public-key])
:compressed-key (get-in wizard-state [:derived constants/path-whisper-keyword :compressed-key])
:name (get-in wizard-state [:derived constants/path-whisper-keyword :name])
:identicon (get-in wizard-state [:derived constants/path-whisper-keyword :identicon])
:processing? (:processing? wizard-state)}))
(re-frame/reg-sub

View File

@ -2,7 +2,6 @@
(:require [utils.datetime :as datetime]))
(def ^:const image-server-uri-prefix "https://localhost:")
(def ^:const identicons-action "/messages/identicons")
(def ^:const account-images-action "/accountImages")
(def ^:const contact-images-action "/contactImages")
(def ^:const generate-qr-action "/GenerateQRCode")
@ -25,19 +24,6 @@
:highest 4
4))
(defn get-identicons-uri
[port public-key theme]
(str image-server-uri-prefix
port
identicons-action
"?publicKey="
public-key
"&theme="
(current-theme-index theme)
"&clock="
(timestamp)
"&addRing=1"))
(defn get-account-image-uri
[port public-key image-name key-uid theme]
(str image-server-uri-prefix