You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: replies_controller.rb
    path of file: ./repos/mastodon/app/controllers/activitypub
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class ActivityPub::RepliesController < ActivityPub::BaseController
  include SignatureVerification
  include Authorization
  include AccountOwnedConcern

  DESCENDANTS_LIMIT = 60

  vary_by -> { 
    
  def next_page
    if only_other_accounts?
      # Only consider remote accounts
      return nil if @replies.size < DESCENDANTS_LIMIT

      account_status_replies_url(
        @account,
        @status,
        page: true,
        min_id: @replies&.last&.id,
        only_other_accounts: true
      )
    else
      # For now, we're serving only self-replies, but next page might be other accounts
      next_only_other_accounts = @replies&.last&.account_id != @account.id || @replies.size < DESCENDANTS_LIMIT

      account_status_replies_url(
        @account,
        @status,
        page: true,
        min_id: next_only_other_accounts ? nil : @replies&.last&.id,
        only_other_accounts: next_only_other_accounts
      )
    end