From 2dd62b78f7c58fc6596855462d08983e05a1d443 Mon Sep 17 00:00:00 2001 From: Benjamin Piouffle Date: Sat, 23 Mar 2019 19:32:29 +0100 Subject: [PATCH 1/2] fix(SubscriptionsMatcher): Don't return canceled subscriptions --- apps/cf/lib/notifications/subscriptions_matcher.ex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/cf/lib/notifications/subscriptions_matcher.ex b/apps/cf/lib/notifications/subscriptions_matcher.ex index c7204c6f..8f79dd25 100644 --- a/apps/cf/lib/notifications/subscriptions_matcher.ex +++ b/apps/cf/lib/notifications/subscriptions_matcher.ex @@ -28,7 +28,7 @@ defmodule CF.Notifications.SubscriptionsMatcher do ) when not is_nil(reply_to_id) do Subscription - |> where([s], s.user_id != ^user_id) + |> where([s], s.user_id != ^user_id and s.is_subscribed == true) |> where( [s], (s.comment_id == ^reply_to_id and s.scope == ^:comment) or @@ -41,7 +41,7 @@ defmodule CF.Notifications.SubscriptionsMatcher do def match_action(action = %{entity: :comment, type: :create, user_id: user_id}) do Subscription - |> where([s], s.user_id != ^user_id) + |> where([s], s.user_id != ^user_id and s.is_subscribed == true) |> where( [s], (s.statement_id == ^action.statement_id and s.scope == ^:statement) or @@ -54,7 +54,7 @@ defmodule CF.Notifications.SubscriptionsMatcher do def match_action(action = %{entity: :statement, type: type, user_id: user_id}) when type in [:update, :remove, :create] do Subscription - |> where([s], s.user_id != ^user_id) + |> where([s], s.user_id != ^user_id and s.is_subscribed == true) |> where( [s], (s.statement_id == ^action.statement_id and s.scope == ^:statement) or @@ -66,7 +66,7 @@ defmodule CF.Notifications.SubscriptionsMatcher do def match_action(%{entity: :video, type: :update, video_id: video_id, user_id: user_id}) do Subscription - |> where([s], s.user_id != ^user_id) + |> where([s], s.user_id != ^user_id and s.is_subscribed == true) |> where([s], s.scope == ^:video) |> where([s], s.video_id == ^video_id) |> Repo.all() @@ -76,7 +76,7 @@ defmodule CF.Notifications.SubscriptionsMatcher do def match_action(%{entity: :speaker, type: type, video_id: video_id, user_id: user_id}) when type in [:add, :remove] do Subscription - |> where([s], s.user_id != ^user_id) + |> where([s], s.user_id != ^user_id and s.is_subscribed == true) |> where([s], s.scope == ^:video) |> where([s], s.video_id == ^video_id) |> Repo.all() From f6c6b87b2a9e119f7c9940921e1c6ee53c84ec34 Mon Sep 17 00:00:00 2001 From: Benjamin Piouffle Date: Mon, 25 Mar 2019 22:26:25 +0100 Subject: [PATCH 2/2] release: Bump version to 1.0.1 --- apps/cf/mix.exs | 2 +- apps/cf_atom_feed/mix.exs | 2 +- apps/cf_graphql/mix.exs | 2 +- apps/cf_jobs/mix.exs | 2 +- apps/cf_opengraph/mix.exs | 2 +- apps/cf_rest_api/mix.exs | 2 +- apps/db/mix.exs | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/cf/mix.exs b/apps/cf/mix.exs index 8fe92a92..b813ec28 100644 --- a/apps/cf/mix.exs +++ b/apps/cf/mix.exs @@ -4,7 +4,7 @@ defmodule CF.Mixfile do def project do [ app: :cf, - version: "1.0.0", + version: "1.0.1", build_path: "../../_build", compilers: [:phoenix, :gettext] ++ Mix.compilers(), config_path: "../../config/config.exs", diff --git a/apps/cf_atom_feed/mix.exs b/apps/cf_atom_feed/mix.exs index 12a851da..e138c01c 100644 --- a/apps/cf_atom_feed/mix.exs +++ b/apps/cf_atom_feed/mix.exs @@ -4,7 +4,7 @@ defmodule CF.AtomFeed.Mixfile do def project do [ app: :cf_atom_feed, - version: "1.0.0", + version: "1.0.1", build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", diff --git a/apps/cf_graphql/mix.exs b/apps/cf_graphql/mix.exs index 4f095e36..1ddfdb63 100644 --- a/apps/cf_graphql/mix.exs +++ b/apps/cf_graphql/mix.exs @@ -4,7 +4,7 @@ defmodule CF.Graphql.Mixfile do def project do [ app: :cf_graphql, - version: "1.0.0", + version: "1.0.1", build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", diff --git a/apps/cf_jobs/mix.exs b/apps/cf_jobs/mix.exs index 7a691481..df09a600 100644 --- a/apps/cf_jobs/mix.exs +++ b/apps/cf_jobs/mix.exs @@ -4,7 +4,7 @@ defmodule CF.Jobs.Mixfile do def project do [ app: :cf_jobs, - version: "1.0.0", + version: "1.0.1", build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", diff --git a/apps/cf_opengraph/mix.exs b/apps/cf_opengraph/mix.exs index 55ef8f09..83ef55e9 100644 --- a/apps/cf_opengraph/mix.exs +++ b/apps/cf_opengraph/mix.exs @@ -4,7 +4,7 @@ defmodule CF.Opengraph.MixProject do def project do [ app: :cf_opengraph, - version: "1.0.0", + version: "1.0.1", elixir: "~> 1.6", start_permanent: Mix.env() == :prod, deps: deps(), diff --git a/apps/cf_rest_api/mix.exs b/apps/cf_rest_api/mix.exs index 7a68e0b8..9790b38f 100644 --- a/apps/cf_rest_api/mix.exs +++ b/apps/cf_rest_api/mix.exs @@ -4,7 +4,7 @@ defmodule CF.RestApi.Mixfile do def project do [ app: :cf_rest_api, - version: "1.0.0", + version: "1.0.1", build_path: "../../_build", compilers: [:phoenix, :gettext] ++ Mix.compilers(), config_path: "../../config/config.exs", diff --git a/apps/db/mix.exs b/apps/db/mix.exs index 8a61d922..2d3a328f 100644 --- a/apps/db/mix.exs +++ b/apps/db/mix.exs @@ -4,7 +4,7 @@ defmodule DB.Mixfile do def project do [ app: :db, - version: "1.0.0", + version: "1.0.1", build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps",