Add more instance stats APIs (#6125)
* Add GET /api/v1/instance/peers API to reveal known domains * Add GET /api/v1/instance/activity API * Make new APIs disableable, exclude private statuses from activity stats * Fix code style issue * Fix week timestamps
This commit is contained in:
		@@ -135,6 +135,7 @@ class Status < ApplicationRecord
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  after_create_commit :store_uri, if: :local?
 | 
			
		||||
  after_create_commit :update_statistics, if: :local?
 | 
			
		||||
 | 
			
		||||
  around_create Mastodon::Snowflake::Callbacks
 | 
			
		||||
 | 
			
		||||
@@ -308,4 +309,9 @@ class Status < ApplicationRecord
 | 
			
		||||
  def set_local
 | 
			
		||||
    self.local = account.local?
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def update_statistics
 | 
			
		||||
    return unless public_visibility? || unlisted_visibility?
 | 
			
		||||
    ActivityTracker.increment('activity:statuses:local')
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user