diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/account.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/account.rb b/app/models/account.rb index 0b025d1be..ce7773b4b 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -137,6 +137,15 @@ class Account < ApplicationRecord subscription_expires_at.present? end + def possibly_stale? + last_webfingered_at.nil? || last_webfingered_at <= 1.day.ago + end + + def refresh! + return if local? + ResolveRemoteAccountService.new.call(acct) + end + def keypair @keypair ||= OpenSSL::PKey::RSA.new(private_key || public_key) end |