Fix all compilation warnings
This commit is contained in:
parent
ed3403ad8b
commit
59770c3f5c
26 changed files with 89 additions and 94 deletions
|
|
@ -108,7 +108,7 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenter do
|
|||
updated_at = activity.data["published"]
|
||||
inserted_at = activity.data["published"]
|
||||
|
||||
in_reply_to = get_in_reply_to(activity.data)
|
||||
_in_reply_to = get_in_reply_to(activity.data)
|
||||
author = if with_author, do: [{:author, UserRepresenter.to_simple_form(user)}], else: []
|
||||
mentions = activity.data["to"] |> get_mentions
|
||||
|
||||
|
|
@ -136,7 +136,7 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenter do
|
|||
updated_at = activity.data["published"]
|
||||
inserted_at = activity.data["published"]
|
||||
|
||||
in_reply_to = get_in_reply_to(activity.data)
|
||||
_in_reply_to = get_in_reply_to(activity.data)
|
||||
author = if with_author, do: [{:author, UserRepresenter.to_simple_form(user)}], else: []
|
||||
|
||||
retweeted_activity = Activity.get_create_activity_by_object_ap_id(activity.data["object"])
|
||||
|
|
@ -233,6 +233,8 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenter do
|
|||
] ++ author
|
||||
end
|
||||
|
||||
def to_simple_form(_, _, _), do: nil
|
||||
|
||||
def wrap_with_entry(simple_form) do
|
||||
[{
|
||||
:entry, [
|
||||
|
|
@ -244,6 +246,4 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenter do
|
|||
], simple_form
|
||||
}]
|
||||
end
|
||||
|
||||
def to_simple_form(_, _, _), do: nil
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ defmodule Pleroma.Web.OStatus.FeedRepresenter do
|
|||
alias Pleroma.Web.OStatus
|
||||
alias Pleroma.Web.OStatus.{UserRepresenter, ActivityRepresenter}
|
||||
|
||||
def to_simple_form(user, activities, users) do
|
||||
def to_simple_form(user, activities, _users) do
|
||||
most_recent_update = (List.first(activities) || user).updated_at
|
||||
|> NaiveDateTime.to_iso8601
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
defmodule Pleroma.Web.OStatus.DeleteHandler do
|
||||
require Logger
|
||||
alias Pleroma.Web.{XML, OStatus}
|
||||
alias Pleroma.{Activity, Object, Repo}
|
||||
alias Pleroma.Web.XML
|
||||
alias Pleroma.Object
|
||||
alias Pleroma.Web.ActivityPub.ActivityPub
|
||||
|
||||
def handle_delete(entry, doc \\ nil) do
|
||||
def handle_delete(entry, _doc \\ nil) do
|
||||
with id <- XML.string_from_xpath("//id", entry),
|
||||
object when not is_nil(object) <- Object.get_by_ap_id(id),
|
||||
{:ok, delete} <- ActivityPub.delete(object, false) do
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ defmodule Pleroma.Web.OStatus do
|
|||
|
||||
alias Pleroma.{Repo, User, Web, Object, Activity}
|
||||
alias Pleroma.Web.ActivityPub.ActivityPub
|
||||
alias Pleroma.Web.ActivityPub.Utils
|
||||
alias Pleroma.Web.{WebFinger, Websub}
|
||||
alias Pleroma.Web.OStatus.{FollowHandler, NoteHandler, DeleteHandler}
|
||||
|
||||
|
|
@ -112,7 +111,7 @@ defmodule Pleroma.Web.OStatus do
|
|||
with id when not is_nil(id) <- string_from_xpath("//activity:object[1]/id", entry),
|
||||
%Activity{} = activity <- Activity.get_create_activity_by_object_ap_id(id) do
|
||||
{:ok, activity}
|
||||
else e ->
|
||||
else _ ->
|
||||
Logger.debug("Couldn't get, will try to fetch")
|
||||
with href when not is_nil(href) <- string_from_xpath("//activity:object[1]/link[@type=\"text/html\"]/@href", entry),
|
||||
{:ok, [favorited_activity]} <- fetch_activity_from_url(href) do
|
||||
|
|
@ -191,7 +190,7 @@ defmodule Pleroma.Web.OStatus do
|
|||
false <- new_data == old_data do
|
||||
change = Ecto.Changeset.change(user, new_data)
|
||||
Repo.update(change)
|
||||
else e ->
|
||||
else _ ->
|
||||
{:ok, user}
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ defmodule Pleroma.Web.OStatus.OStatusController do
|
|||
with [decoded | _] <- Pleroma.Web.Salmon.decode(body),
|
||||
doc <- XML.parse_document(decoded),
|
||||
uri when not is_nil(uri) <- XML.string_from_xpath("/entry/author[1]/uri", doc),
|
||||
{:ok, user} <- Pleroma.Web.OStatus.make_user(uri, true),
|
||||
{:ok, _} <- Pleroma.Web.OStatus.make_user(uri, true),
|
||||
{:ok, magic_key} <- Pleroma.Web.Salmon.fetch_magic_key(body),
|
||||
{:ok, doc} <- Pleroma.Web.Salmon.decode_and_validate(magic_key, body) do
|
||||
{:ok, doc}
|
||||
|
|
@ -54,7 +54,7 @@ defmodule Pleroma.Web.OStatus.OStatusController do
|
|||
end
|
||||
end
|
||||
|
||||
def salmon_incoming(conn, params) do
|
||||
def salmon_incoming(conn, _) do
|
||||
{:ok, body, _conn} = read_body(conn)
|
||||
{:ok, doc} = decode_or_retry(body)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue