Separate PuSH subscriptions from following, add mastodon:push:refresh task,
respect hub.lease_seconds (fix #46)
This commit is contained in:
parent
1245ee42fb
commit
059ebbf48d
10 changed files with 77 additions and 43 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue