Repair retweets.
authorRoger Braun <roger@rogerbraun.net>
Wed, 10 May 2017 17:29:25 +0000 (19:29 +0200)
committerRoger Braun <roger@rogerbraun.net>
Wed, 10 May 2017 17:29:25 +0000 (19:29 +0200)
lib/pleroma/web/ostatus/ostatus.ex
test/web/ostatus/ostatus_test.exs

index b19f0172ac6d5f140cf60b8d755ec1799c046d3b..4fb647a39041f4b8b5e292806899db11fa6c0bfe 100644 (file)
@@ -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
index b326dc0a0978ba25ca5678a20ddb257c84f936b1..e8f81aae69922a60e49c27e9b0aea1c0535106ae 100644 (file)
@@ -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