<commit_before>(ns status-im.ui.screens.group.subs
  (:require [re-frame.core :refer [reg-sub]]
            [status-im.utils.subs :as utils]))

(reg-sub
 :is-contact-selected?
 (utils/contains-sub :group/selected-contacts))

(reg-sub
 :is-participant-selected?
 (utils/contains-sub :selected-participants))

(defn filter-selected-contacts [selected-contacts contacts]
  (remove #(true? (:pending? (contacts %))) selected-contacts))

(reg-sub
 :selected-contacts-count
 :<- [:get :group/selected-contacts]
 :<- [:contacts/contacts]
 (fn [[selected-contacts contacts]]
   (count (filter-selected-contacts selected-contacts contacts))))

(reg-sub
 :selected-participants-count
 :<- [:get :selected-participants]
 (fn [selected-participants]
   (count selected-participants)))

(defn filter-contacts [selected-contacts added-contacts]
  (filter #(selected-contacts (:public-key %)) added-contacts))

(reg-sub
 :selected-group-contacts
 :<- [:get :group/selected-contacts]
 :<- [:all-added-contacts]
 (fn [[selected-contacts added-contacts]]
   (filter-contacts selected-contacts added-contacts)))<commit_msg>[fix 6841] wrongs subscription in group chat<commit_after>(ns status-im.ui.screens.group.subs
  (:require [re-frame.core :refer [reg-sub]]
            [status-im.utils.subs :as utils]))

(reg-sub
 :is-contact-selected?
 (utils/contains-sub :group/selected-contacts))

(reg-sub
 :is-participant-selected?
 (utils/contains-sub :selected-participants))

(defn filter-selected-contacts [selected-contacts contacts]
  (remove #(true? (:pending? (contacts %))) selected-contacts))

(reg-sub
 :selected-contacts-count
 :<- [:get :group/selected-contacts]
 :<- [:contacts/contacts]
 (fn [[selected-contacts contacts]]
   (count (filter-selected-contacts selected-contacts contacts))))

(reg-sub
 :selected-participants-count
 :<- [:get :selected-participants]
 (fn [selected-participants]
   (count selected-participants)))

(defn filter-contacts [selected-contacts added-contacts]
  (filter #(selected-contacts (:public-key %)) added-contacts))

(reg-sub
 :selected-group-contacts
 :<- [:get :group/selected-contacts]
 :<- [:contacts/all-added-people-contacts]
 (fn [[selected-contacts added-contacts]]
   (filter-contacts selected-contacts added-contacts)))
{'fraction_non_alphanumeric': 0.16851441241685144, 'fraction_numerical': 0.0017738359201773836, 'mean_word_length': 4.8903394255874675, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1998290', 'n_tokens_mistral': 785, 'n_tokens_neox': 756, 'n_words': 135}