diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-05-10 19:29:25 +0200 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-05-10 19:29:25 +0200 |
commit | 1b67a597955b87ff792d50bed913b0af59f14edc (patch) | |
tree | d5f5164701774504e651dc4b89f04a413a76a9a2 | |
parent | f73cd6f3ce6d54b29513c8e4f6c7e005c3ae7e96 (diff) | |
download | pleroma-1b67a597955b87ff792d50bed913b0af59f14edc.tar.gz |
Repair retweets.
-rw-r--r-- | lib/pleroma/web/ostatus/ostatus.ex | 4 | ||||
-rw-r--r-- | test/web/ostatus/ostatus_test.exs | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/pleroma/web/ostatus/ostatus.ex b/lib/pleroma/web/ostatus/ostatus.ex index b19f0172a..4fb647a39 100644 --- a/lib/pleroma/web/ostatus/ostatus.ex +++ b/lib/pleroma/web/ostatus/ostatus.ex @@ -120,10 +120,10 @@ defmodule Pleroma.Web.OStatus do end def get_content(entry) do - base_content = string_from_xpath("/entry/content", entry) + base_content = string_from_xpath("//content", entry) with scope when not is_nil(scope) <- string_from_xpath("//mastodon:scope", entry), - cw when not is_nil(cw) <- string_from_xpath("/entry/summary", entry) do + cw when not is_nil(cw) <- string_from_xpath("//summary", entry) do "<span class='mastodon-cw'>#{cw}</span><br>#{base_content}" else _e -> base_content end diff --git a/test/web/ostatus/ostatus_test.exs b/test/web/ostatus/ostatus_test.exs index b326dc0a0..e8f81aae6 100644 --- a/test/web/ostatus/ostatus_test.exs +++ b/test/web/ostatus/ostatus_test.exs @@ -98,6 +98,7 @@ defmodule Pleroma.Web.OStatusTest do assert retweeted_activity.data["actor"] == "https://pleroma.soykaf.com/users/lain" refute retweeted_activity.local assert retweeted_activity.data["object"]["announcement_count"] == 1 + assert String.contains?(retweeted_activity.data["object"]["content"], "mastodon") end test "handle incoming retweets - GS, subscription - local message" do |