forked from AkkomaGang/akkoma
Only push to still valid websub subscriptions.
This commit is contained in:
parent
71cee07686
commit
0067c9d2be
1 changed files with 2 additions and 1 deletions
|
@ -49,7 +49,8 @@ def verify(subscription, getter \\ &@httpoison.get/3) 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
|
||||
|
|
Loading…
Reference in a new issue