Fix software design suggestions

This commit is contained in:
miffigriffi
2019-09-22 18:29:13 +02:00
committed by Thomas Citharel
parent aed824f1aa
commit 0a0d07cf38
36 changed files with 292 additions and 208 deletions

View File

@@ -9,7 +9,7 @@ defmodule MobilizonWeb.ActivityPub.ActorView do
@private_visibility_empty_collection %{elements: [], total: 0}
def render("actor.json", %{actor: actor}) do
public_key = Mobilizon.Service.ActivityPub.Utils.pem_to_public_key_pem(actor.keys)
public_key = Utils.pem_to_public_key_pem(actor.keys)
%{
"id" => actor.url,

View File

@@ -4,12 +4,12 @@ defmodule MobilizonWeb.PageView do
"""
use MobilizonWeb, :view
alias Mobilizon.Actors.Actor
alias Mobilizon.Service.ActivityPub.Utils
alias Mobilizon.Service.ActivityPub.{Converter, Utils}
alias Mobilizon.Service.Metadata
alias Mobilizon.Service.MetadataUtils
def render("actor.activity-json", %{conn: %{assigns: %{object: actor}}}) do
public_key = Mobilizon.Service.ActivityPub.Utils.pem_to_public_key_pem(actor.keys)
public_key = Utils.pem_to_public_key_pem(actor.keys)
%{
"id" => Actor.build_url(actor.preferred_username, :page),
@@ -47,12 +47,12 @@ defmodule MobilizonWeb.PageView do
def render("event.activity-json", %{conn: %{assigns: %{object: event}}}) do
event
|> Mobilizon.Service.ActivityPub.Converters.Event.model_to_as()
|> Converter.Event.model_to_as()
|> Map.merge(Utils.make_json_ld_header())
end
def render("comment.activity-json", %{conn: %{assigns: %{object: comment}}}) do
comment = Mobilizon.Service.ActivityPub.Converters.Comment.model_to_as(comment)
comment = Converter.Comment.model_to_as(comment)
%{
"actor" => comment["actor"],