diff options
author | lain <lain@soykaf.club> | 2018-03-13 18:32:17 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2018-03-13 18:32:17 +0100 |
commit | 0067c9d2be4474a414628461b1248051124408d0 (patch) | |
tree | 63e63ef7eb2e096b98ede82449636cd5231fefaf | |
parent | 71cee0768615e55c18712aad6f4e1344ddd823f1 (diff) | |
download | pleroma-0067c9d2be4474a414628461b1248051124408d0.tar.gz |
Only push to still valid websub subscriptions.
-rw-r--r-- | lib/pleroma/web/websub/websub.ex | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pleroma/web/websub/websub.ex b/lib/pleroma/web/websub/websub.ex index 47a01849d..fa3ab7214 100644 --- a/lib/pleroma/web/websub/websub.ex +++ b/lib/pleroma/web/websub/websub.ex @@ -49,7 +49,8 @@ defmodule Pleroma.Web.Websub do def publish(topic, user, %{data: %{"type" => type}} = activity) when type in @supported_activities do # TODO: Only send to still valid subscriptions. query = from sub in WebsubServerSubscription, - where: sub.topic == ^topic and sub.state == "active" + where: sub.topic == ^topic and sub.state == "active", + where: fragment("? > NOW()", sub.valid_until) subscriptions = Repo.all(query) Enum.each(subscriptions, fn(sub) -> response = user |