You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
446 B

  1. # frozen_string_literal: true
  2. class IntentsController < ApplicationController
  3. def show
  4. uri = Addressable::URI.parse(params[:uri])
  5. if uri.scheme == 'web+mastodon'
  6. case uri.host
  7. when 'follow'
  8. return redirect_to authorize_follow_path(acct: uri.query_values['uri'].gsub(/\Aacct:/, ''))
  9. when 'share'
  10. return redirect_to share_path(text: uri.query_values['text'])
  11. end
  12. end
  13. not_found
  14. end
  15. end