about summary refs log tree commit diff
path: root/app/controllers/api
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-09-20 00:39:03 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-09-20 00:43:36 +0200
commit059ebbf48dc56971b88e26a15303a75643de8b98 (patch)
treef0d46b941f298912094fe5a87b192d6fa8d4d304 /app/controllers/api
parent1245ee42fb9f689ffa4956f42f44a7ab75e19075 (diff)
Separate PuSH subscriptions from following, add mastodon:push:refresh task,
respect hub.lease_seconds (fix #46)
Diffstat (limited to 'app/controllers/api')
-rw-r--r--app/controllers/api/subscriptions_controller.rb1
1 files changed, 1 insertions, 0 deletions
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