mirror of
https://github.com/diaspora/diaspora.git
synced 2026-01-10 23:58:09 -05:00
LinksController redirects requests for provided diaspora:// links to respective entities urls.
17 lines
315 B
Ruby
17 lines
315 B
Ruby
# frozen_string_literal: true
|
|
|
|
class LinksController < ApplicationController
|
|
def resolve
|
|
entity = DiasporaLinkService.new(query).find_or_fetch_entity
|
|
raise ActiveRecord::RecordNotFound if entity.nil?
|
|
|
|
redirect_to url_for(entity)
|
|
end
|
|
|
|
private
|
|
|
|
def query
|
|
@query ||= params.fetch(:q)
|
|
end
|
|
end
|