X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fostatus%2Fostatus.ex;h=882226172f8da39481f4dacbc35a96f032bbc772;hb=cd6cba2f670cd75107fedff1681215f3a5d7c64b;hp=02a0996b0c80f6fe4bb143267af30bedb4b9a028;hpb=8004ee8ccfa63181fb103ea50db3b10956d81ce9;p=akkoma diff --git a/lib/pleroma/web/ostatus/ostatus.ex b/lib/pleroma/web/ostatus/ostatus.ex index 02a0996b0..882226172 100644 --- a/lib/pleroma/web/ostatus/ostatus.ex +++ b/lib/pleroma/web/ostatus/ostatus.ex @@ -56,6 +56,7 @@ defmodule Pleroma.Web.OStatus do rescue e -> Logger.error("Error occured while handling activity") + Logger.error(xml_string) Logger.error(inspect(e)) nil end @@ -177,8 +178,8 @@ defmodule Pleroma.Web.OStatus do with false <- user.local, avatar <- make_avatar_object(doc), bio <- string_from_xpath("//author[1]/summary", doc), - name when not is_nil(name) <- string_from_xpath("//author[1]/poco:displayName", doc), - new_data <- %{avatar: avatar, name: name, bio: bio}, + name <- string_from_xpath("//author[1]/poco:displayName", doc), + new_data <- %{avatar: avatar || old_data.avatar, name: name || old_data.name, bio: bio || old_data.bio}, false <- new_data == old_data do change = Ecto.Changeset.change(user, new_data) Repo.update(change) @@ -299,7 +300,7 @@ defmodule Pleroma.Web.OStatus do end def fetch_activity_from_url(url) do - with {:ok, activities} <- fetch_activity_from_atom_url(url) do + with {:ok, activities} when length(activities) > 0 <- fetch_activity_from_atom_url(url) do {:ok, activities} else _e -> with {:ok, activities} <- fetch_activity_from_html_url(url) do