Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
75d1896426 | ||
|
|
03c4814563 | ||
|
|
95380175a6 | ||
|
|
dbf7ca839c | ||
|
|
50135bdace | ||
|
|
61d7f08fbc | ||
|
|
17385cca94 | ||
|
|
73bc097a4e | ||
|
|
b23372f842 | ||
|
|
243c0d60da | ||
|
|
3d1c2cdccb |
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.6.6'
|
||||
library 'status-jenkins-lib@v1.6.5'
|
||||
|
||||
/* Options section can't access functions in objects. */
|
||||
def isPRBuild = utils.isPRBuild()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.6.6'
|
||||
library 'status-jenkins-lib@v1.6.3'
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.6.6'
|
||||
library 'status-jenkins-lib@v1.6.5'
|
||||
|
||||
/* Options section can't access functions in objects. */
|
||||
def isPRBuild = utils.isPRBuild()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.6.6'
|
||||
library 'status-jenkins-lib@v1.6.3'
|
||||
|
||||
pipeline {
|
||||
agent { label params.AGENT_LABEL }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.6.6'
|
||||
library 'status-jenkins-lib@v1.6.3'
|
||||
|
||||
/* Options section can't access functions in objects. */
|
||||
def isPRBuild = utils.isPRBuild()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.6.6'
|
||||
library 'status-jenkins-lib@v1.6.5'
|
||||
|
||||
pipeline {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.6.6'
|
||||
library 'status-jenkins-lib@v1.6.3'
|
||||
|
||||
pipeline {
|
||||
agent { label 'macos' }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.6.6'
|
||||
library 'status-jenkins-lib@v1.6.3'
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<true/>
|
||||
<key>ITSEncryptionExportComplianceCode</key>
|
||||
<string>37d5ac79-0eb2-4e66-9117-8a8515185a7f</string>
|
||||
<string>1aa92c4d-6194-4d7d-b70a-16b48256b87e</string>
|
||||
<key>LSApplicationQueriesSchemes</key>
|
||||
<array>
|
||||
<string>whatsapp</string>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<true/>
|
||||
<key>ITSEncryptionExportComplianceCode</key>
|
||||
<string>37d5ac79-0eb2-4e66-9117-8a8515185a7f</string>
|
||||
<string>1aa92c4d-6194-4d7d-b70a-16b48256b87e</string>
|
||||
<key>LSApplicationQueriesSchemes</key>
|
||||
<array>
|
||||
<string>whatsapp</string>
|
||||
|
||||
@@ -193,21 +193,17 @@
|
||||
[alias name nickname]))
|
||||
|
||||
(defn add-searchable-phrases-to-contact
|
||||
[{:keys [alias name added? blocked? identicon public-key nickname ens-verified display-name]}
|
||||
community-chat?]
|
||||
[{:keys [alias name added? blocked? identicon public-key nickname ens-verified]} community-chat?]
|
||||
(when (and alias
|
||||
(not (string/blank? alias))
|
||||
(or name
|
||||
display-name
|
||||
nickname
|
||||
added?
|
||||
community-chat?)
|
||||
(not blocked?))
|
||||
(add-searchable-phrases
|
||||
{:alias alias
|
||||
:name (or (and ens-verified (utils/safe-replace name ".stateofus.eth" ""))
|
||||
(when-not (string/blank? display-name) display-name)
|
||||
alias)
|
||||
:name (or (and ens-verified (utils/safe-replace name ".stateofus.eth" "")) alias)
|
||||
:identicon identicon
|
||||
:nickname nickname
|
||||
:ens-verified ens-verified
|
||||
|
||||
@@ -43,8 +43,8 @@
|
||||
(defn sort-contacts
|
||||
[contacts]
|
||||
(sort (fn [c1 c2]
|
||||
(let [name1 (first (:two-names c1))
|
||||
name2 (first (:two-names c2))]
|
||||
(let [name1 (or (:name c1) (:address c1) (:public-key c1))
|
||||
name2 (or (:name c2) (:address c2) (:public-key c2))]
|
||||
(compare (string/lower-case name1)
|
||||
(string/lower-case name2))))
|
||||
(vals contacts)))
|
||||
|
||||
@@ -40,8 +40,11 @@
|
||||
:three-words-name (or alias (gfycat/generate-gfy public-key))}
|
||||
;; Preferred name is our own otherwise we make sure it's verified
|
||||
(or preferred-name (and ens-verified name))
|
||||
(assoc :ens-name (or (stateofus/username ens-name) ens-name)))))
|
||||
(assoc :ens-name (str "@" (or (stateofus/username ens-name) ens-name))))))
|
||||
|
||||
;; NOTE: this does a bit of unnecessary work, we could short-circuit the work
|
||||
;; once the first two are found, i.e don't calculate short key if 2 are already
|
||||
;; available
|
||||
(defn contact-two-names
|
||||
"Returns vector of two names in next order nickname, ens name, display-name, three word name, public key"
|
||||
[{:keys [names
|
||||
@@ -53,30 +56,28 @@
|
||||
display-name
|
||||
three-words-name]}
|
||||
(or names (contact-names contact))
|
||||
non-empty-names (remove string/blank? [nickname ens-name display-name three-words-name])]
|
||||
(if (> (count non-empty-names) 1)
|
||||
(vec (take 2 non-empty-names))
|
||||
[(first non-empty-names)
|
||||
(when public-key? (utils/get-shortened-address (or compressed-key public-key)))])))
|
||||
short-public-key (when public-key?
|
||||
(utils/get-shortened-address (or compressed-key
|
||||
public-key)))]
|
||||
(->> [nickname ens-name display-name three-words-name short-public-key]
|
||||
(remove string/blank?)
|
||||
(take 2))))
|
||||
|
||||
(defn contact-with-names
|
||||
"Returns contact with :names map "
|
||||
[contact]
|
||||
(let [contact' (assoc contact :names (contact-names contact))]
|
||||
(assoc contact' :two-names (contact-two-names contact' true))))
|
||||
(assoc contact :names (contact-names contact)))
|
||||
|
||||
(defn displayed-name
|
||||
"Use preferred name, display-name, name or alias in that order"
|
||||
[{:keys [name display-name preferred-name alias public-key ens-verified]}]
|
||||
(let [display-name (if (string/blank? display-name) nil display-name)
|
||||
ens-name (or preferred-name
|
||||
display-name
|
||||
"Use preferred name, name or alias in that order"
|
||||
[{:keys [name preferred-name alias public-key ens-verified]}]
|
||||
(let [ens-name (or preferred-name
|
||||
name)]
|
||||
;; Preferred name is our own otherwise we make sure it's verified
|
||||
(if (or preferred-name (and ens-verified name))
|
||||
(let [username (stateofus/username ens-name)]
|
||||
(or username ens-name))
|
||||
(or display-name alias (gfycat/generate-gfy public-key)))))
|
||||
(str "@" (or username ens-name)))
|
||||
(or alias (gfycat/generate-gfy public-key)))))
|
||||
|
||||
(defn contact-by-identity
|
||||
[contacts identity]
|
||||
|
||||
@@ -29,11 +29,11 @@
|
||||
(testing "names is nil"
|
||||
(testing "nickname has precedence"
|
||||
(is
|
||||
(= [nickname ens-name]
|
||||
(= [nickname formatted-ens]
|
||||
(ma/contact-two-names contact public-key))))
|
||||
(testing "ens name is second option"
|
||||
(is
|
||||
(= [ens-name display-name]
|
||||
(= [formatted-ens display-name]
|
||||
(ma/contact-two-names
|
||||
(dissoc contact :nickname)
|
||||
public-key))))
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
[status-im.ethereum.core :as ethereum]
|
||||
[status-im.ethereum.eip681 :as eip681]
|
||||
[status-im.ethereum.ens :as ens]
|
||||
[status-im.utils.types :as types]
|
||||
[status-im.native-module.core :as status]
|
||||
[status-im.ethereum.stateofus :as stateofus]
|
||||
[status-im2.utils.validators :as validators]
|
||||
[status-im.utils.http :as http]
|
||||
@@ -73,27 +71,15 @@
|
||||
|
||||
(defn match-contact-async
|
||||
[chain {:keys [user-id ens-name]} callback]
|
||||
(let [valid-public-key? (and (validators/valid-public-key? user-id)
|
||||
(not= user-id ens/default-key))
|
||||
valid-compressed-key? (validators/valid-compressed-key? user-id)]
|
||||
(let [valid-key (and (validators/valid-public-key? user-id)
|
||||
(not= user-id ens/default-key))]
|
||||
(cond
|
||||
valid-public-key?
|
||||
valid-key
|
||||
(callback {:type :contact
|
||||
:public-key user-id
|
||||
:ens-name ens-name})
|
||||
|
||||
valid-compressed-key?
|
||||
(status/compressed-key->public-key
|
||||
user-id
|
||||
(fn [response]
|
||||
(let [{:keys [error]} (types/json->clj response)]
|
||||
(when-not error
|
||||
(match-contact-async
|
||||
chain
|
||||
{:user-id (str "0x" (subs response 5)) :ens-name ens-name}
|
||||
callback)))))
|
||||
|
||||
(and (not valid-public-key?)
|
||||
(and (not valid-key)
|
||||
(string? user-id)
|
||||
(not (string/blank? user-id))
|
||||
(not= user-id "0x"))
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
:justify-content :center
|
||||
:align-items :center})
|
||||
|
||||
(def chat-button
|
||||
{:position :absolute
|
||||
:bottom 30
|
||||
:align-self :center})
|
||||
(defn chat-button
|
||||
[{:keys [bottom]}]
|
||||
{:bottom (- bottom 50)})
|
||||
|
||||
@@ -6,12 +6,14 @@
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.constants :as constants]
|
||||
[utils.i18n :as i18n]
|
||||
[react-native.core :as rn]
|
||||
[status-im.ui.components.react :as react]
|
||||
[utils.re-frame :as rf]
|
||||
[status-im.ui.components.toolbar :as toolbar]
|
||||
[status-im2.common.contact-list.view :as contact-list]
|
||||
[quo2.components.markdown.text :as text]
|
||||
[status-im.ui.components.invite.events :as invite.events]
|
||||
[status-im.ui2.screens.chat.components.new-chat.styles :as style]
|
||||
[quo.components.safe-area :as safe-area]
|
||||
[status-im.react-native.resources :as resources]))
|
||||
|
||||
(defn- hide-sheet-and-dispatch
|
||||
@@ -31,11 +33,11 @@
|
||||
|
||||
(defn- no-contacts-view
|
||||
[]
|
||||
[rn/view
|
||||
[react/view
|
||||
{:style {:justify-content :center
|
||||
:align-items :center
|
||||
:margin-top 120}}
|
||||
[rn/image
|
||||
[react/image
|
||||
{:source (resources/get-image (if (quo2.colors/dark?) :no-contacts-dark :no-contacts))}]
|
||||
[text/text
|
||||
{:weight :semi-bold
|
||||
@@ -72,8 +74,9 @@
|
||||
added? (reagent/atom '())
|
||||
{:keys [nickname ens-name three-words-name]} names
|
||||
first-username (or ens-name nickname three-words-name)
|
||||
no-contacts? (empty? contacts)]
|
||||
[rn/view {:style {:height (* window-height 0.9)}}
|
||||
no-contacts? (empty? contacts)
|
||||
safe-area (safe-area/use-safe-area)]
|
||||
[react/view {:style {:height (* window-height 0.9)}}
|
||||
[quo2/button
|
||||
{:type :grey
|
||||
:icon true
|
||||
@@ -82,7 +85,7 @@
|
||||
:override-background-color (quo2.colors/theme-colors quo2.colors/neutral-10
|
||||
quo2.colors/neutral-90)}
|
||||
:i/close]
|
||||
[rn/view style/contact-selection-heading
|
||||
[react/view style/contact-selection-heading
|
||||
[quo2/text
|
||||
{:weight :semi-bold
|
||||
:size :heading-1
|
||||
@@ -96,8 +99,9 @@
|
||||
(i18n/label :t/selected-count-from-max
|
||||
{:selected (inc selected-contacts-count)
|
||||
:max constants/max-group-chat-participants})])]
|
||||
[rn/view
|
||||
{:style {:flex 1}}
|
||||
[react/view
|
||||
{:style {:height 430
|
||||
:margin-bottom -20}}
|
||||
(if no-contacts?
|
||||
[no-contacts-view]
|
||||
[contact-list/contact-list
|
||||
@@ -106,19 +110,21 @@
|
||||
:added? added?
|
||||
:search? false
|
||||
:start-a-new-chat? true
|
||||
:on-toggle on-toggle}
|
||||
70])]
|
||||
:on-toggle on-toggle}])]
|
||||
(when contacts-selected?
|
||||
[button/button
|
||||
{:type :primary
|
||||
:style style/chat-button
|
||||
:accessibility-label :next-button
|
||||
:on-press (fn []
|
||||
(if one-contact-selected?
|
||||
(hide-sheet-and-dispatch [:chat.ui/start-chat
|
||||
public-key])
|
||||
(hide-sheet-and-dispatch [:navigate-to
|
||||
:new-group])))}
|
||||
(if one-contact-selected?
|
||||
(i18n/label :t/chat-with {:selected-user first-username})
|
||||
(i18n/label :t/setup-group-chat))])]))])
|
||||
[toolbar/toolbar
|
||||
{:size :default
|
||||
:show-border? false
|
||||
:center [button/button
|
||||
{:type :primary
|
||||
:accessibility-label :next-button
|
||||
:style (style/chat-button safe-area)
|
||||
:on-press (fn []
|
||||
(if one-contact-selected?
|
||||
(hide-sheet-and-dispatch [:chat.ui/start-chat
|
||||
public-key])
|
||||
(hide-sheet-and-dispatch [:navigate-to
|
||||
:new-group])))}
|
||||
(if one-contact-selected?
|
||||
(i18n/label :t/chat-with {:selected-user first-username})
|
||||
(i18n/label :t/setup-group-chat))]}])]))])
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
(rf/sub [:contacts/contact-name-by-identity from]))
|
||||
|
||||
(defn render-inline
|
||||
[_message-text content-type acc {:keys [type literal destination]}]
|
||||
[_message-text content-type acc {:keys [type literal destination]} use-status-tag?]
|
||||
(case type
|
||||
""
|
||||
(conj acc literal)
|
||||
@@ -82,9 +82,10 @@
|
||||
"status-tag"
|
||||
(conj acc
|
||||
[rn/text
|
||||
{:style {:color :blue
|
||||
:text-decoration-line :underline}
|
||||
:on-press #(rf/dispatch [:chat.ui/start-public-chat literal])}
|
||||
(when use-status-tag?
|
||||
{:style {:color :blue
|
||||
:text-decoration-line :underline}
|
||||
:on-press #(rf/dispatch [:chat.ui/start-public-chat literal])})
|
||||
"#"
|
||||
literal])
|
||||
|
||||
@@ -96,13 +97,15 @@
|
||||
;; TEXT
|
||||
(defn render-block
|
||||
[{:keys [content content-type edited-at in-popover?]} acc
|
||||
{:keys [type ^js literal children]}]
|
||||
{:keys [type ^js literal children]}
|
||||
use-status-tag?]
|
||||
|
||||
(case type
|
||||
|
||||
"paragraph"
|
||||
(conj acc
|
||||
(reduce
|
||||
(fn [acc e] (render-inline (:text content) content-type acc e))
|
||||
(fn [acc e] (render-inline (:text content) content-type acc e use-status-tag?))
|
||||
[rn/text (style/text-style content-type in-popover?)]
|
||||
(conj
|
||||
children
|
||||
@@ -123,11 +126,13 @@
|
||||
acc))
|
||||
|
||||
(defn render-parsed-text
|
||||
[{:keys [content] :as message-data}]
|
||||
(reduce (fn [acc e]
|
||||
(render-block message-data acc e))
|
||||
[:<>]
|
||||
(:parsed-text content)))
|
||||
[{:keys [content chat-id] :as message-data}]
|
||||
(let [{:keys [chat-type]} (rf/sub [:chats/chat chat-id])
|
||||
use-status-tag? (= constants/community-chat-type chat-type)]
|
||||
(reduce (fn [acc e]
|
||||
(render-block message-data acc e use-status-tag?))
|
||||
[:<>]
|
||||
(:parsed-text content))))
|
||||
|
||||
(defn quoted-message
|
||||
[{:keys [message-id chat-id]} reply pin?]
|
||||
@@ -288,7 +293,7 @@
|
||||
[rn/view style/status-container
|
||||
[rn/text {:style (style/status-text)}
|
||||
(reduce
|
||||
(fn [acc e] (render-inline (:text content) content-type acc e))
|
||||
(fn [acc e] (render-inline (:text content) content-type acc e false))
|
||||
[rn/text {:style (style/status-text)}]
|
||||
(-> content :parsed-text peek :children))]])
|
||||
|
||||
|
||||
@@ -113,7 +113,11 @@
|
||||
:pop-to-root-tab-fx :profile-stack}
|
||||
|
||||
public-key
|
||||
{:dispatch [:chat.ui/show-profile public-key ens-name]}))
|
||||
(navigation/navigate-to-cofx (-> cofx
|
||||
(assoc-in [:db :contacts/identity] public-key)
|
||||
(assoc-in [:db :contacts/ens-name] ens-name))
|
||||
:profile
|
||||
{})))
|
||||
|
||||
(rf/defn handle-eip681
|
||||
[cofx data]
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
[quo/divider-label {:label title}])
|
||||
|
||||
(defn contact-list
|
||||
[data padding-bottom]
|
||||
[data]
|
||||
(let [contacts (if (:group data)
|
||||
(rf/sub [:contacts/grouped-by-first-letter])
|
||||
(rf/sub [:contacts/filtered-active-sections]))]
|
||||
@@ -18,6 +18,6 @@
|
||||
:sticky-section-headers-enabled false
|
||||
:sections contacts
|
||||
:render-section-header-fn contacts-section-header
|
||||
:content-container-style {:padding-bottom (or padding-bottom 20)}
|
||||
:content-container-style {:padding-bottom 20}
|
||||
:render-data data
|
||||
:render-fn contact-list-item/contact-list-item}]))
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
{:type :negative :label (i18n/label :t/declined)}
|
||||
nil)}
|
||||
(case (:contact-request-state message)
|
||||
constants/contact-request-message-state-pending
|
||||
constants/contact-request-state-mutual
|
||||
{:button-1 {:label (i18n/label :t/decline)
|
||||
:accessibility-label :decline-contact-request
|
||||
:type :danger
|
||||
|
||||
@@ -134,16 +134,16 @@
|
||||
(case content-type
|
||||
|
||||
constants/content-type-text
|
||||
[content.text/text-content message-data context]
|
||||
[not-implemented/not-implemented [content.text/text-content message-data context]]
|
||||
|
||||
constants/content-type-emoji
|
||||
[old-message/emoji message-data]
|
||||
[not-implemented/not-implemented [old-message/emoji message-data]]
|
||||
|
||||
constants/content-type-sticker
|
||||
[old-message/sticker message-data]
|
||||
[not-implemented/not-implemented [old-message/sticker message-data]]
|
||||
|
||||
constants/content-type-audio
|
||||
[old-message/audio message-data]
|
||||
[not-implemented/not-implemented [old-message/audio message-data]]
|
||||
|
||||
constants/content-type-image
|
||||
[image/image-message 0 message-data context on-long-press]
|
||||
@@ -151,7 +151,7 @@
|
||||
constants/content-type-album
|
||||
[album/album-message message-data context on-long-press]
|
||||
|
||||
[content.unknown/unknown-content message-data])
|
||||
[not-implemented/not-implemented [content.unknown/unknown-content message-data]])
|
||||
(when @show-delivery-state?
|
||||
[status/status outgoing-status])]]]])))])
|
||||
|
||||
|
||||
@@ -76,10 +76,16 @@
|
||||
:contacts/active-sections
|
||||
:<- [:contacts/active]
|
||||
(fn [contacts]
|
||||
(->> contacts
|
||||
(group-by #(string/upper-case (ffirst (:two-names %))))
|
||||
sort
|
||||
(mapv (fn [[title items]] {:title title :data items})))))
|
||||
(-> (reduce
|
||||
(fn [acc contact]
|
||||
(let [first-char (first (:alias contact))]
|
||||
(if (get acc first-char)
|
||||
(update-in acc [first-char :data] #(conj % contact))
|
||||
(assoc acc first-char {:title first-char :data [contact]}))))
|
||||
{}
|
||||
contacts)
|
||||
sort
|
||||
vals)))
|
||||
|
||||
(re-frame/reg-sub
|
||||
:contacts/grouped-by-first-letter
|
||||
|
||||
@@ -95,8 +95,7 @@
|
||||
:names {:nickname nil
|
||||
:display-name ""
|
||||
:three-words-name "Fake Slim Shady"
|
||||
:ens-name "slim.shady"}
|
||||
:two-names ["slim.shady" "Fake Slim Shady"]
|
||||
:ens-name "@slim.shady"}
|
||||
:has-added-us true
|
||||
:contact-request-state 1}]}
|
||||
{:title "I"
|
||||
@@ -125,8 +124,7 @@
|
||||
:names {:nickname nil
|
||||
:display-name ""
|
||||
:three-words-name "Instant noodles"
|
||||
:ens-name "slim.shady"}
|
||||
:two-names ["slim.shady" "Instant noodles"]
|
||||
:ens-name "@slim.shady"}
|
||||
:has-added-us true
|
||||
:contact-request-state 1}]}
|
||||
{:title "R"
|
||||
@@ -155,8 +153,7 @@
|
||||
:names {:nickname nil
|
||||
:display-name ""
|
||||
:three-words-name "Real Slim Shady"
|
||||
:ens-name "slim.shady"}
|
||||
:two-names ["slim.shady" "Real Slim Shady"]
|
||||
:ens-name "@slim.shady"}
|
||||
:has-added-us true
|
||||
:contact-request-state 1}]}])
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
|
||||
"owner": "status-im",
|
||||
"repo": "status-go",
|
||||
"version": "v0.131.7+hotfix.1",
|
||||
"commit-sha1": "47263752fca6d2efab08430aa71d33296374b805",
|
||||
"src-sha256": "1fsv1nlqw0rln01alzr5bqlh9mkh2jjwxg1binfiwq34fk91r4sq"
|
||||
"version": "v0.130.0",
|
||||
"commit-sha1": "dea21f440a9f630c4b8324fcde0b016d6c3fc02b",
|
||||
"src-sha256": "1w9iyigj0rkqfnyb8m9w802r1lx1cydg41p8qb7hnsry2bgrfk97"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user