Remove contact request notification from activity center when request is canceled
This commit is contained in:
parent
901081a4cf
commit
b06d63d200
|
@ -35,6 +35,7 @@
|
||||||
(def ^:const timeline-chat-type 5)
|
(def ^:const timeline-chat-type 5)
|
||||||
(def ^:const community-chat-type 6)
|
(def ^:const community-chat-type 6)
|
||||||
|
|
||||||
|
(def ^:const contact-request-message-state-none 0)
|
||||||
(def ^:const contact-request-message-state-pending 1)
|
(def ^:const contact-request-message-state-pending 1)
|
||||||
(def ^:const contact-request-message-state-accepted 2)
|
(def ^:const contact-request-message-state-accepted 2)
|
||||||
(def ^:const contact-request-message-state-declined 3)
|
(def ^:const contact-request-message-state-declined 3)
|
||||||
|
|
|
@ -1928,19 +1928,25 @@
|
||||||
(re-frame/reg-sub
|
(re-frame/reg-sub
|
||||||
:activity.center/notifications-grouped-by-date
|
:activity.center/notifications-grouped-by-date
|
||||||
:<- [:activity.center/notifications]
|
:<- [:activity.center/notifications]
|
||||||
(fn [{:keys [notifications]}]
|
:<- [:contacts/contacts]
|
||||||
|
(fn [[{:keys [notifications]} contacts]]
|
||||||
(let [supported-notifications
|
(let [supported-notifications
|
||||||
(filter (fn [{:keys [type last-message]}]
|
(filter (fn [{:keys [type last-message message]}]
|
||||||
(or (and (= constants/activity-center-notification-type-one-to-one-chat type)
|
(or (and (= constants/activity-center-notification-type-one-to-one-chat type)
|
||||||
(not (nil? last-message)))
|
(not (nil? last-message)))
|
||||||
(= constants/activity-center-notification-type-contact-request type)
|
(and (= constants/activity-center-notification-type-contact-request type)
|
||||||
|
(not= constants/contact-request-message-state-none
|
||||||
|
(-> contacts
|
||||||
|
(multiaccounts/contact-by-identity (:from message))
|
||||||
|
:contact-request-state)))
|
||||||
(= constants/activity-center-notification-type-contact-request-retracted type)
|
(= constants/activity-center-notification-type-contact-request-retracted type)
|
||||||
(= constants/activity-center-notification-type-private-group-chat type)
|
(= constants/activity-center-notification-type-private-group-chat type)
|
||||||
(= constants/activity-center-notification-type-reply type)
|
(= constants/activity-center-notification-type-reply type)
|
||||||
(= constants/activity-center-notification-type-mention type)))
|
(= constants/activity-center-notification-type-mention type)))
|
||||||
notifications)]
|
notifications)]
|
||||||
(group-notifications-by-date
|
(group-notifications-by-date
|
||||||
(map #(assoc % :timestamp (or (:timestamp %) (:timestamp (or (:message %) (:last-message %)))))
|
(map #(assoc % :timestamp (or (:timestamp %) (:timestamp (or (:message %) (:last-message %))))
|
||||||
|
:contact (multiaccounts/contact-by-identity contacts (get-in % [:message :from])))
|
||||||
supported-notifications)))))
|
supported-notifications)))))
|
||||||
|
|
||||||
;;WALLET TRANSACTIONS ==================================================================================================
|
;;WALLET TRANSACTIONS ==================================================================================================
|
||||||
|
|
|
@ -132,4 +132,5 @@
|
||||||
constants/contact-request-message-state-declined
|
constants/contact-request-message-state-declined
|
||||||
[quo/text {:style {:color colors/red}} (i18n/label :t/declined)]
|
[quo/text {:style {:color colors/red}} (i18n/label :t/declined)]
|
||||||
constants/contact-request-message-state-pending
|
constants/contact-request-message-state-pending
|
||||||
[contact-request-actions (:message-id message)])])]))
|
[contact-request-actions (:message-id message)]
|
||||||
|
nil)])]))
|
||||||
|
|
Loading…
Reference in New Issue