projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'upstream/develop' into feature/openldap-support
[akkoma]
/
lib
/
pleroma
/
web
/
ostatus
/
ostatus.ex
diff --git
a/lib/pleroma/web/ostatus/ostatus.ex
b/lib/pleroma/web/ostatus/ostatus.ex
index c6440c20e9daa1d1248494fb201fe7aed7785b6a..266f86bf47d35bde3f605ec4251cd6e4ddac4ac7 100644
(file)
--- a/
lib/pleroma/web/ostatus/ostatus.ex
+++ b/
lib/pleroma/web/ostatus/ostatus.ex
@@
-1,3
+1,7
@@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
defmodule Pleroma.Web.OStatus do
@httpoison Application.get_env(:pleroma, :httpoison)
defmodule Pleroma.Web.OStatus do
@httpoison Application.get_env(:pleroma, :httpoison)
@@
-5,11
+9,19
@@
defmodule Pleroma.Web.OStatus do
import Pleroma.Web.XML
require Logger
import Pleroma.Web.XML
require Logger
- alias Pleroma.{Repo, User, Web, Object, Activity}
+ alias Pleroma.Activity
+ alias Pleroma.Object
+ alias Pleroma.Repo
+ alias Pleroma.User
+ alias Pleroma.Web
alias Pleroma.Web.ActivityPub.ActivityPub
alias Pleroma.Web.ActivityPub.ActivityPub
- alias Pleroma.Web.{WebFinger, Websub}
- alias Pleroma.Web.OStatus.{FollowHandler, UnfollowHandler, NoteHandler, DeleteHandler}
alias Pleroma.Web.ActivityPub.Transmogrifier
alias Pleroma.Web.ActivityPub.Transmogrifier
+ alias Pleroma.Web.OStatus.DeleteHandler
+ alias Pleroma.Web.OStatus.FollowHandler
+ alias Pleroma.Web.OStatus.NoteHandler
+ alias Pleroma.Web.OStatus.UnfollowHandler
+ alias Pleroma.Web.WebFinger
+ alias Pleroma.Web.Websub
def is_representable?(%Activity{data: data}) do
object = Object.normalize(data["object"])
def is_representable?(%Activity{data: data}) do
object = Object.normalize(data["object"])
@@
-44,6
+56,9
@@
defmodule Pleroma.Web.OStatus do
def handle_incoming(xml_string) do
with doc when doc != :error <- parse_document(xml_string) do
def handle_incoming(xml_string) do
with doc when doc != :error <- parse_document(xml_string) do
+ with {:ok, actor_user} <- find_make_or_update_user(doc),
+ do: Pleroma.Instances.set_reachable(actor_user.ap_id)
+
entries = :xmerl_xpath.string('//entry', doc)
activities =
entries = :xmerl_xpath.string('//entry', doc)
activities =
@@
-144,7
+159,7
@@
defmodule Pleroma.Web.OStatus do
Logger.debug("Trying to get entry from db")
with id when not is_nil(id) <- string_from_xpath("//activity:object[1]/id", entry),
Logger.debug("Trying to get entry from db")
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
+ %Activity{} = activity <- Activity.get_create_by_object_ap_id(id) do
{:ok, activity}
else
_ ->
{:ok, activity}
else
_ ->