From aa583b0707821573a861fcbbe421dc89354b09f8 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 8 Jan 2025 13:34:13 +0100 Subject: [PATCH] :lipstick: Remove redundant set conversions --- backend/src/app/rpc/commands/comments.clj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/src/app/rpc/commands/comments.clj b/backend/src/app/rpc/commands/comments.clj index da6fdbc1f..2d4c6d293 100644 --- a/backend/src/app/rpc/commands/comments.clj +++ b/backend/src/app/rpc/commands/comments.clj @@ -90,23 +90,23 @@ ;; Users mentioned in this comment comment-mentions - (-> (set (:mentions comment)) + (-> (:mentions comment) (set/difference #{profile-id})) ;; Users mentioned in this thread thread-mentions - (-> (set (:mentions thread)) + (-> (:mentions thread) ;; Remove the mentions in the thread because we're already sending a ;; notification (set/difference comment-mentions) - (set/difference #{profile-id})) + (disj profile-id)) ;; All users notificate-users-ids (-> (set (keys team-users)) (set/difference comment-mentions) (set/difference thread-mentions) - (set/difference #{profile-id}))] + (disj profile-id))] (doseq [mention comment-mentions] (let [{:keys [fullname email mention-email?]} (get team-users mention)] @@ -154,7 +154,7 @@ (cond-> row (db/pgpoint? position) (assoc :position (db/decode-pgpoint position)) (db/pgobject? participants) (assoc :participants (db/decode-transit-pgobject participants)) - (db/pgarray? mentions) (assoc :mentions (db/decode-pgarray mentions)))) + (db/pgarray? mentions) (assoc :mentions (db/decode-pgarray mentions #{})))) (def xf-decode-row (map decode-row))