From: Roger Braun Date: Mon, 1 May 2017 18:09:00 +0000 (+0200) Subject: Some servers send empty lease_seconds requests... X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=aa209414164cf098376d8aefb3f2af16111bd220;p=akkoma Some servers send empty lease_seconds requests... --- diff --git a/lib/pleroma/web/websub/websub.ex b/lib/pleroma/web/websub/websub.ex index b279a5060..905c237a0 100644 --- a/lib/pleroma/web/websub/websub.ex +++ b/lib/pleroma/web/websub/websub.ex @@ -89,6 +89,11 @@ defmodule Pleroma.Web.Websub do Repo.get_by(WebsubServerSubscription, topic: topic, callback: callback) || %WebsubServerSubscription{} end + # Temp hack for mastodon. + defp lease_time(%{"hub.lease_seconds" => ""}) do + {:ok, 60 * 60 * 24 * 3} # three days + end + defp lease_time(%{"hub.lease_seconds" => lease_seconds}) do {:ok, String.to_integer(lease_seconds)} end