|
9 | 9 | [taoensso.timbre :as log]
|
10 | 10 | [utils.collection :as collection]
|
11 | 11 | [utils.i18n :as i18n]
|
12 |
| - [utils.re-frame :as rf])) |
| 12 | + [utils.re-frame :as rf] |
| 13 | + [status-im.utils.identicon :as identicon] |
| 14 | + [clojure.string :as string])) |
13 | 15 |
|
14 | 16 | (def defaults
|
15 | 17 | {:filter-status :unread
|
|
532 | 534 | [{:keys [db]} new-notifications]
|
533 | 535 | (let [my-public-key (get-in db [:multiaccount :public-key])]
|
534 | 536 | (reduce (fn [cofx {:keys [author type accepted dismissed message name] :as x}]
|
535 |
| - (cond |
536 |
| - (and (not= author my-public-key) |
537 |
| - (= type types/contact-request) |
538 |
| - (not accepted) |
539 |
| - (not dismissed)) |
540 |
| - (toasts/upsert cofx |
541 |
| - {:icon :placeholder |
542 |
| - :icon-color colors/primary-50-opa-40 |
543 |
| - :title (i18n/label :t/contact-request-sent-toast |
544 |
| - {:name name}) |
545 |
| - :text (get-in message [:content :text])}) |
546 |
| - |
547 |
| - (and (= author my-public-key) ;; we show it for user who sent the request |
548 |
| - (= type types/contact-request) |
549 |
| - accepted |
550 |
| - (not dismissed)) |
551 |
| - (toasts/upsert cofx |
552 |
| - {:icon :placeholder |
553 |
| - :icon-color colors/primary-50-opa-40 |
554 |
| - :title (i18n/label :t/contact-request-accepted-toast |
555 |
| - {:name (or name (:alias message))})}) |
556 |
| - |
557 |
| - :else |
558 |
| - cofx)) |
| 537 | + (let [user-avatar {:full-name name |
| 538 | + :status-indicator? true |
| 539 | + :online? nil |
| 540 | + :size :small |
| 541 | + :ring? false}] |
| 542 | + (cond |
| 543 | + (and (not= author my-public-key) |
| 544 | + (= type types/contact-request) |
| 545 | + (not accepted) |
| 546 | + (not dismissed)) |
| 547 | + (toasts/upsert cofx |
| 548 | + {:user user-avatar |
| 549 | + :icon-color colors/primary-50-opa-40 |
| 550 | + :title (i18n/label :t/contact-request-sent-toast |
| 551 | + {:name name}) |
| 552 | + :text (get-in message [:content :text])}) |
| 553 | + |
| 554 | + (and (= author my-public-key) ;; we show it for user who sent the request |
| 555 | + (= type types/contact-request) |
| 556 | + accepted |
| 557 | + (not dismissed)) |
| 558 | + (toasts/upsert cofx |
| 559 | + {:user user-avatar |
| 560 | + :icon-color colors/success-50-opa-40 |
| 561 | + :title (i18n/label :t/contact-request-accepted-toast |
| 562 | + {:name (or name (:alias message))})}) |
| 563 | + :else |
| 564 | + cofx))) |
559 | 565 | {:db db}
|
560 | 566 | new-notifications)))
|
0 commit comments