From 059ebbf48dc56971b88e26a15303a75643de8b98 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 20 Sep 2016 00:39:03 +0200 Subject: Separate PuSH subscriptions from following, add mastodon:push:refresh task, respect hub.lease_seconds (fix #46) --- app/controllers/api/subscriptions_controller.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app/controllers') diff --git a/app/controllers/api/subscriptions_controller.rb b/app/controllers/api/subscriptions_controller.rb index e923b9b66..84b88765a 100644 --- a/app/controllers/api/subscriptions_controller.rb +++ b/app/controllers/api/subscriptions_controller.rb @@ -4,6 +4,7 @@ class Api::SubscriptionsController < ApiController def show if @account.subscription(api_subscription_url(@account.id)).valid?(params['hub.topic'], params['hub.verify_token']) + @account.update(subscription_expires_at: Time.now + (params['hub.lease_seconds'].to_i).seconds) render plain: HTMLEntities.new.encode(params['hub.challenge']), status: 200 else head 404 -- cgit