X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fwebsub%2Fwebsub.ex;h=5caa8198c10efe87d3a6c5531cf6c1df5f56c544;hb=9b97b023c53b88f4c04aed17e36022201016b6c9;hp=47a01849df74bc8b5bec01ff4b66954f9e8cb752;hpb=611ca385dea3d611a97579000311cc42684305e6;p=akkoma diff --git a/lib/pleroma/web/websub/websub.ex b/lib/pleroma/web/websub/websub.ex index 47a01849d..5caa8198c 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 @@ -97,7 +98,7 @@ defmodule Pleroma.Web.Websub do {:ok, websub} else {:error, reason} -> - Logger.debug("Couldn't create subscription.") + Logger.debug("Couldn't create subscription") Logger.debug(inspect(reason)) {:error, reason}