Browse Source

Repair retweets.

tags/v0.9.9
Roger Braun 7 years ago
parent
commit
1b67a59795
2 changed files with 3 additions and 2 deletions
  1. +2
    -2
      lib/pleroma/web/ostatus/ostatus.ex
  2. +1
    -0
      test/web/ostatus/ostatus_test.exs

+ 2
- 2
lib/pleroma/web/ostatus/ostatus.ex View 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


+ 1
- 0
test/web/ostatus/ostatus_test.exs View 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


Loading…
Cancel
Save