with id <- o_status_url(conn, :object, uuid),
%Activity{} = activity <- Activity.get_create_activity_by_object_ap_id(id),
%User{} = user <- User.get_cached_by_ap_id(activity.data["actor"]) do
- represent_activity(conn, activity, user)
+ case get_format(conn) do
+ "html" -> redirect(conn, to: "/notice/#{activity.id}")
+ _ -> represent_activity(conn, activity, user)
+ end
end
end
with id <- o_status_url(conn, :activity, uuid),
%Activity{} = activity <- Activity.get_by_ap_id(id),
%User{} = user <- User.get_cached_by_ap_id(activity.data["actor"]) do
- represent_activity(conn, activity, user)
+ case get_format(conn) do
+ "html" -> redirect(conn, to: "/notice/#{activity.id}")
+ _ -> represent_activity(conn, activity, user)
+ end
end
end
end
pipeline :ostatus do
- plug :accepts, ["xml", "atom"]
+ plug :accepts, ["xml", "atom", "html"]
end
scope "/", Pleroma.Web do
scope "/", Fallback do
get "/*path", RedirectController, :redirector
end
-
end
defmodule Fallback.RedirectController do