diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-04-25 17:45:34 +0200 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-04-25 17:45:34 +0200 |
commit | b438ea24ee936ae10efdcd3c9079e3b45ae521f4 (patch) | |
tree | 3c3a50fec8e671bc25836719cac5d0e2de11f82d /lib | |
parent | 6c5f5e18ec1103a9d10d88081a27c2ae9dba4f41 (diff) | |
download | pleroma-b438ea24ee936ae10efdcd3c9079e3b45ae521f4.tar.gz |
Add ostatus conversation as context.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/ostatus/ostatus.ex | 7 | ||||
-rw-r--r-- | lib/pleroma/web/twitter_api/twitter_api.ex | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/pleroma/web/ostatus/ostatus.ex b/lib/pleroma/web/ostatus/ostatus.ex index 4fd649c92..8c31ce5aa 100644 --- a/lib/pleroma/web/ostatus/ostatus.ex +++ b/lib/pleroma/web/ostatus/ostatus.ex @@ -41,7 +41,12 @@ defmodule Pleroma.Web.OStatus do [author] = :xmerl_xpath.string('/entry/author[1]', doc) {:ok, actor} = find_or_make_user(author) - context = ActivityPub.generate_context_id + context = string_from_xpath("/entry/ostatus:conversation[1]", doc) |> String.trim + context = if String.length(context) > 0 do + context + else + ActivityPub.generate_context_id + end to = [ "https://www.w3.org/ns/activitystreams#Public" diff --git a/lib/pleroma/web/twitter_api/twitter_api.ex b/lib/pleroma/web/twitter_api/twitter_api.ex index cb48c7f5f..e4e26df15 100644 --- a/lib/pleroma/web/twitter_api/twitter_api.ex +++ b/lib/pleroma/web/twitter_api/twitter_api.ex @@ -253,7 +253,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do {:error, changeset} -> errors = Ecto.Changeset.traverse_errors(changeset, fn {msg, _opts} -> msg end) |> Poison.encode! - {:error, %{error: errors}} + {:error, %{error: errors}} end end |